This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: PATCH COMMITTED: Use conditional moves in groups of assignments
On Tue, 31 Jan 2006, Richard Earnshaw wrote:
> On Sun, 2006-01-29 at 08:30, Hans-Peter Nilsson wrote:> > That looks wrong: the false if_then_else arm isn't supposed to
> > be executed *at all* i.e. not for side-effects like
> > post-increment. It's not logical; the false if_then_else arm of
> > a conditional branch using if_then_else evaluated (usually just
> > a label; but the address isn't evaluated for validity).
> > Neither is it in similar common language constructs, like the C
> > "cond ? x : y". construct.
>
> It's not wrong. Consider the case where the false arm needs reloads.
> The reloads are unconditionally executed.
That's a convenience argument, but not a definition.
> if_then_else is defined in a
> way such that only the final result is conditional, not the side
> effects.
Defined *where*? I don't see this pecularity mentioned in e.g.
rtl.texi, md.texi or rtl.def. It'd be quite important to
document (not just as stray comments).
brgds, H-P