On April 26, 2017 8:03:44 PM GMT+02:00, Steve Ellcey <sell...@cavium.com> wrote:
>On Wed, 2017-04-26 at 11:33 +0200, Richard Biener wrote:
>> > 
>> > Index: gcc/emit-rtl.c
>> > ===================================================================
>> > --- gcc/emit-rtl.c      (revision 247273)
>> > +++ gcc/emit-rtl.c      (working copy)
>> > @@ -1954,7 +1954,10 @@ set_mem_attributes_minus_bitpos (rtx ref
>> >           while (TREE_CODE (t2) == ARRAY_REF);
>> > 
>> >           if (DECL_P (t2)
>> > -             || TREE_CODE (t2) == COMPONENT_REF)
>> > +             || (TREE_CODE (t2) == COMPONENT_REF
>> > +                 /* For trailing arrays t2 doesn't have a size
>that
>> > +                    covers all valid accesses.  */
>> > +                 && ! array_at_struct_end_p (t, false)))
>> >             {
>> >               attrs.expr = t2;
>> >               attrs.offset_known_p = false;
>> > 
>> > is probably better.
>> > 
>> > Richard.
>
>I tested this patch and it fixed my problem.  It does seem better than
>my patch because now the [0] and [] versions of my test generate
>exactly the same code.  With my patch they still generated different
>code though both versions worked OK.
>
>I did a full bootstrap and gcc testsuite run on aarch64 with no
>regressions.  Will you check this in or do you want me to do a
>submission and checkin?

I'll throw it on x86 testing and will commit it.  What branches are affected?  
Can you open a bugreport?

I'll try to add a runtime testcase as well if you don't beat me to that.  On 
x86 it likely requires -fschedule-insns to trigger.

Richard.

>Steve Ellcey
>sell...@cavium.com

Reply via email to