https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92342

--- Comment #7 from Segher Boessenkool <segher at gcc dot gnu.org> ---
(In reply to Richard Earnshaw from comment #5)
> So if the AND-based idiom is now preferred, shouldn't the if-then-else
> variant be transformed into it?

Neither form is canonical currently.

The form you *really* want tests a CCmode var, but combine will not
give you that (unless it started with one), so you'll need md patterns
for it.

> Similarly for IOR, when we get
> 
> (IOR (NEG (<cond-op>)) (reg))
> 
> from
> 
> (IF_THEN_ELSE (<cond-op>)
>   (reg)
>   (const_int -1))

Yeah.  And some more variants.

I think the IF_THEN_ELSE version should be canonical, and it should be
formed in simplify_rtx, not at random spots in combine.

Reply via email to