compiler: let initializers hold addresses of fields
commitde048538b4482c97e53861000cef7b20070b9f65
authorian <ian@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 27 Jan 2017 15:08:23 +0000 (27 15:08 +0000)
committerian <ian@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 27 Jan 2017 15:08:23 +0000 (27 15:08 +0000)
treea7ccb6363b9382bcc300d5b7ef9a3e7533e048d1
parentb6a78a82118258590ef0192807cf0b107ac9bc4d
compiler: let initializers hold addresses of fields

    The runtime.dbgvars initializer looks like

    var dbgvars = []dbgVar{
            {"allocfreetrace", &debug.allocfreetrace},
    }

    Because the field address was not recognized as valid for a static
    initializer, the variable was initialized at runtime.  Normally that
    would be fine, but for the runtime package it meant that dbgvars was
    not initialized when it was read by parsedebugvars.  That meant that
    the GODEBUG environment variable did nothing.

    Fixing that revealed that the static initializer checks had to be more
    careful about interface types, just like the existing is_constant
    methods.

    Reviewed-on: https://go-review.googlesource.com/35891

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@244982 138bc75d-0d04-0410-961f-82ee72b054a4
gcc/go/gofrontend/MERGE
gcc/go/gofrontend/expressions.cc
gcc/go/gofrontend/expressions.h