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: Fix PR41879 (large mgrid regression)


On Sat, Jan 16, 2010 at 11:24 PM, Michael Matz <matz@suse.de> wrote:
> Hi,
>
> On Sat, 16 Jan 2010, Richard Guenther wrote:
>
>> > @@ -631,6 +644,12 @@ split_constant_offset_1 (tree type, tree
>> >
>> > ? ? ? ?return split_constant_offset_1 (type, var0, subcode, var1, var, off);
>> > ? ? ? }
>> > + ? ?CASE_CONVERT:
>> > + ? ? ?{
>> > + ? ? ? ?split_constant_offset (op0, &var0, off);
>> > + ? ? ? *var = fold_convert (type, var0);
>> > + ? ? ? return true;
>>
>> I suppose we arrive with pointer operations here and the case in
>> question also involves pointer conversions?
>
> Yep, there were also the typical fortran int4 -> int8 conversions
> involved, I don't remember if those mattered, though.
>
>> I'm a bit concerned about not converting the offset here in case the
>> conversion was widening -
>
> The returned offset is always of sizetype, not possible to go wider than
> this.
>
>> we'll probably ICE during the recursion in that case. ?So, can you
>> restrict this to pointer-to-pointer conversions?
>
> Given the above, should I still do this?

I think you can end up with

  tmp_6 = ptr_7 + 8;
  tmp_5 = (sizetype) tmp_6;
  tmp_1 = (short) tmp_5;
  tmp_2 = (sizetype) tmp_1;
  ptr_4 = ptr_3 + tmp_2;

where you'd drop the truncation when splitting ptr_3 + tmp_2.

So I think yes, better play safe for now given that we're late for 4.5 already.

Thanks,
Richard.

>
> Ciao,
> Michael.


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