This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [tree-ssa] Fix PR 14470
- From: Jason Merrill <jason at redhat dot com>
- To: Diego Novillo <dnovillo at redhat dot com>
- Cc: "gcc-patches at gcc dot gnu dot org" <gcc-patches at gcc dot gnu dot org>
- Date: Wed, 14 Apr 2004 15:05:24 -0400
- Subject: Re: [tree-ssa] Fix PR 14470
- References: <1081969083.25023.24.camel@localhost.localdomain>
On Wed, 14 Apr 2004 14:58:03 -0400, Diego Novillo <dnovillo@redhat.com> wrote:
> The problem boils down to 'd = t[d]++' being gimplified into:
>
> T.1 = t[d];
> d = T.1;
> T.2 = T.1 + 1;
> t[d] = T.2;
>
> Instead of
>
> T.1 = t[d];
> T.3 = T.1;
> T.2 = T.1 + 1;
> t[d] = T.2;
> d = T.3;
>
> I have told the gimplifier to force the post-side effects of the RHS of
> assignments to happen before the assignment itself. I am not actually
> sure if this is the right semantics to implement, but it seems to me to
> be the only way of doing it.
Another way would be to force the array index to be a temporary, which
seems more correct to me.
Jason