This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Canonicalize &a to &a[0] during fold
- From: Richard Guenther <rguenth at tat dot physik dot uni-tuebingen dot de>
- To: Richard Henderson <rth at redhat dot com>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Mon, 25 Apr 2005 11:06:44 +0200 (CEST)
- Subject: Re: [PATCH] Canonicalize &a to &a[0] during fold
On Sun, 24 Apr 2005, Richard Henderson wrote:
> On Sun, Apr 24, 2005 at 07:15:01PM +0200, Richard Guenther wrote:
> > * fold-const.c (fold_unary): Fold decayed array a to &a[0].
>
> I'd kinda prefer this get fixed in the front ends instead of doing
> this in fold...
I would have come up with followups that also replace
(a + i) with &a[i]. Should this also be fixed in the frontends?
I.e. the C frontend currently would need tweaking.
The downside is that we "tie" the frontends closer to the middle-end
this way.
I'll prepare a patch for the C frontend.
Richard.
--
Richard Guenther <richard dot guenther at uni-tuebingen dot de>
WWW: http://www.tat.physik.uni-tuebingen.de/~rguenth/