https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109401
--- Comment #5 from Andrew Pinski <pinskia at gcc dot gnu.org> --- (In reply to Jakub Jelinek from comment #4) > (In reply to Andrew Pinski from comment #2) > > Something like this: > > (for op (somebinarops) > > (simplify > > (op:c (min:c @0 @1) (max:c @0 @1)) > > (if (!FLOAT_TYPE_P(type)) > > Why? Commutative ops don't care which operand is first and which is second > even when honoring NaNs or signed zeros. It is not the commutative ops that is the issue but rather the definition of min/max is the issue. From what I remember those two are not well defined. Oh min/max should be added to the list of communative ops too; though there might be already patterns for those.