SIMPLE: A language-independent tree IR

Geoff Keating geoffk@geoffk.org
Wed Jan 2 17:30:00 GMT 2002


Toon Moene <toon@moene.indiv.nluug.nl> writes:

> Richard Henderson wrote:
> 
> > Yes, we must do something special to represent this.  Otherwise
> > we can't tell the difference between
> > 
> >         Z = A + B + C + D
> >         Z = ((A + B) + C) + D
> > 
> > and, given a pipelined fpu, clearly you want the former rendered as
> > 
> >         t1 = A + B
> >         t2 = C + D
> >         Z = t1 + t2
> 
> Ah, yes - I see.  The obvious way to parse both expressions would be
> 
>       t1 = A + B
>       t2 = t1 + C
>       Z = t2 + D
> 
> while there _is_ a reordering difference between the two.
> 
> Still, I feel this is different from the "sequence point" concept of the
> C language, but I cannot come up with a simple example that shows it.

You're probably thinking of

T = (f() + g())
compared to
T = (f(), g())

in the first one, the compiler is (probably) permitted to call g
before f, but not in the second.

-- 
- Geoffrey Keating <geoffk@geoffk.org> <geoffk@redhat.com>



More information about the Gcc mailing list