This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: GCC 6 RFA: Go patch: call determine_types even for constant expressions
- From: Ian Lance Taylor <iant at golang dot org>
- To: gcc-patches <gcc-patches at gcc dot gnu dot org>
- Cc: "gofrontend-dev at googlegroups dot com" <gofrontend-dev at googlegroups dot com>
- Date: Mon, 23 Jan 2017 19:34:16 -0800
- Subject: Re: GCC 6 RFA: Go patch: call determine_types even for constant expressions
- Authentication-results: sourceware.org; auth=none
- References: <CAOyqgcVORxK4XbbZb8t8vNe74eZRmUJVivY=KGJiMZMyVTSORA@mail.gmail.com>
On Thu, Dec 15, 2016 at 4:25 PM, Ian Lance Taylor <iant@golang.org> wrote:
> On Thu, Dec 15, 2016 at 2:47 PM, Ian Lance Taylor <iant@golang.org> wrote:
>> The Go frontend needs to call determine_types even for constant
>> expressions, which it was not doing. The problem is that 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.
>>
>> This fixes GCC PR 78763.
>>
>> Bootstrapped and ran Go testsuite on x86_64-pc-linux-gnu. Committed
>> to mainline.
>
>
> In order to fix GCC PR 78763, I'd like to commit this patch to the GCC
> 6 branch. I've bootstrapped the test on x86_64-pc-linux-gnu, and
> verified that the Go tests continue to pass.
Now committed to GCC 6 branch.
Ian