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

Richard Biener <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |rguenth at gcc dot gnu.org

--- Comment #2 from Richard Biener <rguenth at gcc dot gnu.org> ---
We have

 /* X / -X is -1.  */
 (simplify
   (div:C @0 (negate @0))
...

which doesn't use (negate_expr_p @0) but that wouldn't help because

(match negate_expr_p
 (minus @0 @1)
 (if ((ANY_INTEGRAL_TYPE_P (type) && TYPE_OVERFLOW_WRAPS (type))
      || (FLOAT_TYPE_P (type)
          && !HONOR_SIGN_DEPENDENT_ROUNDING (type)
          && !HONOR_SIGNED_ZEROS (type)))))

as (a - b) might be INT_MIN which we can't negate w/o invoking undefined
behavior.  We also don't have (negate_expr_p @0), a way to match the
then negated form.

VN might come to the rescue to turn b - a to -(a - b) if that is available.

Reply via email to