r243729 - in /trunk/gcc/go/gofrontend: MERGE ex...
ian@gcc.gnu.org
ian@gcc.gnu.org
Thu Dec 15 22:47:00 GMT 2016
Author: ian
Date: Thu Dec 15 22:47:43 2016
New Revision: 243729
URL: https://gcc.gnu.org/viewcvs?rev=243729&root=gcc&view=rev
Log:
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
Modified:
trunk/gcc/go/gofrontend/MERGE
trunk/gcc/go/gofrontend/expressions.cc
trunk/gcc/go/gofrontend/expressions.h
More information about the Gcc-cvs
mailing list