This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: fix 23714
- From: Diego Novillo <dnovillo at redhat dot com>
- To: Ulrich Weigand <Ulrich dot Weigand at de dot ibm dot com>
- Cc: David Edelsohn <dje at watson dot ibm dot com>, gcc-patches at gcc dot gnu dot org, Andrew Pinski <pinskia at physics dot uc dot edu>, Richard Henderson <rth at redhat dot com>
- Date: Fri, 14 Oct 2005 13:38:45 -0400
- Subject: Re: fix 23714
- References: <OF535A5B74.1ADA099C-ON4225709A.005606F4-4225709A.00562FC1@de.ibm.com>
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.