This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug middle-end/34130] [4.1/4.2/4.3 Regression] the builtin abs() gives wrong result when used in some expression



------- Comment #1 from rguenth at gcc dot gnu dot org  2007-11-17 12:46 -------
Confirmed.

int foo(int i)
{
  return -2*__builtin_abs(i-2);
}

get's folded to

 return ABS_EXPR <(2 - i) * 2>;

doh.


-- 

rguenth at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
          Component|c                           |middle-end
     Ever Confirmed|0                           |1
           Keywords|                            |wrong-code
      Known to fail|                            |3.3.6 3.4.6 4.1.3 4.2.2
                   |                            |4.3.0
      Known to work|                            |2.95.4
   Last reconfirmed|0000-00-00 00:00:00         |2007-11-17 12:46:11
               date|                            |
            Summary|the builtin abs() gives     |[4.1/4.2/4.3 Regression] the
                   |wrong result when used in   |builtin abs() gives wrong
                   |some expression             |result when used in some
                   |                            |expression
   Target Milestone|---                         |4.2.3
            Version|unknown                     |4.2.1


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=34130


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]