[Bug middle-end/61734] [4.10 Regression] Regression in ABS_EXPR recognition

ebotcazou at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Mon Jul 7 15:27:00 GMT 2014


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

Eric Botcazou <ebotcazou at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2014-07-07
     Ever confirmed|0                           |1

--- Comment #1 from Eric Botcazou <ebotcazou at gcc dot gnu.org> ---
Indeed, there is a conflict between fold_cond_expr_with_comparison:

  /* If we have A op 0 ? A : -A, consider applying the following
     transformations:

     A == 0? A : -A    same as -A
     A != 0? A : -A    same as A
     A >= 0? A : -A    same as abs (A)
     A > 0?  A : -A    same as abs (A)
     A <= 0? A : -A    same as -abs (A)
     A < 0?  A : -A    same as -abs (A)

and fold_comparison:

  /* Transform comparisons of the form X - Y CMP 0 to X CMP Y.  */



More information about the Gcc-bugs mailing list