https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78763

--- Comment #12 from ian at gcc dot gnu.org <ian at gcc dot gnu.org> ---
Author: ian
Date: Tue Jan 24 03:34:14 2017
New Revision: 244852

URL: https://gcc.gnu.org/viewcvs?rev=244852&root=gcc&view=rev
Log:
        PR go/78763

    Backported from mainline:

    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:
    branches/gcc-6-branch/gcc/go/gofrontend/expressions.cc
    branches/gcc-6-branch/gcc/go/gofrontend/expressions.h

Reply via email to