This is the mail archive of the gcc@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: SIMPLE: A language-independent tree IR


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>


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