This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Fix middle-end/81737
- From: Richard Biener <richard dot guenther at gmail dot com>
- To: gcc-patches at gcc dot gnu dot org,Marek Polacek <polacek at redhat dot com>,Jakub Jelinek <jakub at redhat dot com>
- Cc: GCC Patches <gcc-patches at gcc dot gnu dot org>
- Date: Mon, 07 Aug 2017 16:07:49 +0200
- Subject: Re: [PATCH] Fix middle-end/81737
- Authentication-results: sourceware.org; auth=none
- References: <20170807084751.GC17069@redhat.com> <20170807085809.GJ2123@tucnak> <20170807090959.GD17069@redhat.com>
On August 7, 2017 11:09:59 AM GMT+02:00, Marek Polacek <polacek@redhat.com> wrote:
>On Mon, Aug 07, 2017 at 10:58:09AM +0200, Jakub Jelinek wrote:
>> On Mon, Aug 07, 2017 at 10:47:51AM +0200, Marek Polacek wrote:
>> > In my recent change I failed to check whether the type domain
>> > of a type is non-NULL and this goof causes crashing on this
>> > testcase.
>> >
>> > Bootstrapped/regtested on x86_64-linux, ok for trunk?
>> >
>> > 2017-08-07 Marek Polacek <polacek@redhat.com>
>> >
>> > PR middle-end/81737
>> > * fold-const.c (fold_indirect_ref_1): Check type_domain.
>> >
>> > * gcc.dg/pr81737.c: New test.
>>
>> The old code was assuming size_zero_node if type_domain is NULL
>> or TYPE_MIN_VALUE is NULL, which is reasonable for C/C++, but indeed
>might
>> be wrong perhaps for Fortran or Ada.
It's how the middle-end defines it, so please restore this behavior (sorry for missing this in the review). IIRC there are at least one other 'copy' of the folding somewhere.
Richard.
>Yeah, I did what Richi suggested doing in
>https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81695#c4
>
>> Hopefully nothing will assume this has to be folded in these cases
>(mainly
>> thinking about C++ constexpr).
>
>We'll see soon I suspect ;).
>
>> So ok.
>
>Thanks,
>
> Marek