This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [tree-ssa] Fix PR 14470


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]