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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
     Ever confirmed|0                           |1
           Keywords|                            |missed-optimization
   Last reconfirmed|                            |2023-01-16

--- Comment #1 from Richard Biener <rguenth at gcc dot gnu.org> ---
Confirmed.  With -fwrapv

/* y == XXX_MIN || x < y --> x <= y - 1 */
(simplify
 (bit_ior:c (eq:s @1 min_value) (lt:cs @0 @1))
  (if (INTEGRAL_TYPE_P (TREE_TYPE (@1))
       && TYPE_OVERFLOW_WRAPS (TREE_TYPE (@1)))
  (le @0 (minus @1 { build_int_cst (TREE_TYPE (@1), 1); }))))

triggers.  We could with !TYPE_OVERFLOW_WRAPS write the
subtraction in an unsigned type to make it well-defined.

Reply via email to