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: PATCH COMMITTED: Use conditional moves in groups of assignments


Note we have two conditional forms in RTL: cond_exec and if_then_else.

COND_EXEC is uses when all side effects are suppressed when the insn
fails its condition.  IF_THEN_ELSE is used for situations where the
side-effects are performed even if the value is not used.  So

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).

It's not wrong. Consider the case where the false arm needs reloads. The reloads are unconditionally executed.

Apart from this (which may be considered an implementation nit), what Richard is saying makes sense to me. Nothing in RTL is ever short-circuited, except COND_EXEC. If I am not mistaken, combine relies heavily on this by constructing IF_THEN_ELSE expressions more or less arbitrarily.


Paolo


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