fix 23714

Diego Novillo dnovillo@redhat.com
Fri Oct 14 17:39:00 GMT 2005


On Friday 14 October 2005 11:41, Ulrich Weigand wrote:
> Diego Novillo <dnovillo@redhat.com> wrote on 14.10.2005 17:27:25:
> > On Tuesday 11 October 2005 16:59, Andrew Pinski wrote:
> > > ChangeLog:
> > >    * tree-cfg.c (mark_array_ref_addressable_1): If the array
> > >    reference is in bounds, don't do anything.
> >
> > Well, I don't know if this is safe.  If *all* the references to this
>
> array
>
> > are in_array_bounds_p, how come the array wasn't SRA'd?
>
> I'd assume this is because the array is member of a union, see e.g.:
> http://gcc.gnu.org/ml/gcc-patches/2005-10/msg00636.html
>
Yes, that was the reason.  Thanks.

After poking around this PR a bit, I think Andrew's patch should be safe.  
If an ARRAY_REF is dereferenced by a constant index that's within the 
bounds of the array's type, then we don't need to mark it addressable, 
we'll always be able to build constant offsets for these.

Richard, I'll leave the final decision to you.  I may be missing other 
corner cases.



More information about the Gcc-patches mailing list