|Side effects in expressions firstname.lastname@example.org (Tzvetan Mikov) (1999-08-18)|
|Re: Side effects in expressions email@example.com (1999-08-18)|
|Re: Side effects in expressions firstname.lastname@example.org (1999-08-21)|
|From:||email@example.com (John McEnerney)|
|Date:||21 Aug 1999 01:55:45 -0400|
Tzvetan Mikov" <firstname.lastname@example.org> wrote:
> > So, this expression is calculated correctly and we can even easily apply a
> > very simple common sub-expression elimination. What happens however if we
> > have sub-expressions with side effects? Examine this C code:
> > int * p = ...;
> > x = *(p = p + 1) + *(p = p + 1);
email@example.com (John McEnerney) wrote:
> But I think that the usual understanding is that during translation
> from abstract syntax trees to IL, side-effecting expressions are
> hoisted as if they were independent statements. This is also true of
> flow-of-control operators like && and || and ?:.
> So all side-effects occur as the "root" of the expressions that
> contain them.
Oops. I meant to say: side-effects are hoisted so that they become roots
of their own expression trees.
John McEnerney (firstname.lastname@example.org)
Return to the
Search the comp.compilers archives again.