This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] Fix middle-end/81737


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]