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?
Steve Ellcey
[email protected]