]> git.ipfire.org Git - thirdparty/gcc.git/commit - gcc/go/gofrontend/expressions.cc
PR go/78763
authorian <ian@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 15 Dec 2016 22:47:43 +0000 (22:47 +0000)
committerian <ian@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 15 Dec 2016 22:47:43 +0000 (22:47 +0000)
commitaf7a52747c01a7359a22ef67febeb5fb39d9ff84
tree59845f6dec919b79bac4beebf830fee954ad3678
parent6fdca905a149eeec90f0e23373c3d941d02be59e
PR go/78763
    compiler: call determine_types even for constant expressions

    We need to call determine_types even for constant expressions, since a
    constant expression may include code like unsafe.Sizeof(0).  Something
    needs to determine the type of the untyped 0, and that should be the
    determine_types pass.

    Implementing that triggered a compiler crash on test/const1.go because
    it permitted some erroneous constants to make it all the way to the
    backend.  Catch that case by checking whether we get a constant
    overflow error, and marking the expression invalid if we do.  This is
    a good change in any case, as previously we reported the same constant
    overflow error multiple times, and now we only report it once.

    Fixes GCC PR 78763.

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

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