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 rtl-optimization/44683] Optimization bug with copysign builtin



------- Comment #4 from rguenth at gcc dot gnu dot org  2010-06-26 22:57 -------
Confirmed.  Somewhere during RTL opts we thread a jump the wrong way.  Also
happens with SSE math.

int __attribute__((noinline,noclone))
copysign_bug (double x)
{
  if (x != 0.0 && (x * 0.5 == x))
    return 1;
  if (__builtin_copysign(1.0, x) < 0.0)
    return 2;
  else
    return 3;
}
int main(void)
{
  double x = -0.0;
  if (copysign_bug (x) != 2)
    __builtin_abort ();
  return 0;
}


-- 

rguenth at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
          Component|c                           |rtl-optimization
     Ever Confirmed|0                           |1
 GCC target triplet|i386-pc-solaris2.11         |i?86-*-*
           Keywords|                            |wrong-code
      Known to fail|                            |4.6.0
   Last reconfirmed|0000-00-00 00:00:00         |2010-06-26 22:57:46
               date|                            |


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


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