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

--- Comment #4 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Solving this one is easier, just going with:
/* (nop_outer_cast)-(inner_cast)var -> -(outer_cast)(var)
   if var is smaller in precision. */
(simplify
 (convert (negate:s@1 (convert:s @0)))
 (if (INTEGRAL_TYPE_P (type)
      && tree_nop_conversion_p (type, TREE_TYPE (@1))
      && TYPE_PRECISION (type) > TYPE_PRECISION (TREE_TYPE (@0)))
    (negate (convert @0))))

Reply via email to