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

H.J. Lu <hjl.tools at gmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2017-10-26
                 CC|                            |ubizjak at gmail dot com
          Component|c                           |target
     Ever confirmed|0                           |1

--- Comment #1 from H.J. Lu <hjl.tools at gmail dot com> ---
It miscompiled:

double
__y0 (double x)
{
  if (__builtin_expect (islessequal (x, 0.0) || isgreater (x, X_TLOSS), 0)
      && _LIB_VERSION != _IEEE_)
    {
      if (x < 0.0)
        {
          /* d = zero/(x-x) */
          __feraiseexcept (FE_INVALID);
          return __kernel_standard (x, x, 9);
        }
      else if (x == 0.0)
        {
          /* d = -one/(x-x) */
          __feraiseexcept (FE_DIVBYZERO);
          return __kernel_standard (x, x, 8);
        }
      else if (_LIB_VERSION != _POSIX_)
        /* y0(x>X_TLOSS) */
        return __kernel_standard (x, x, 35);
    }

  return __ieee754_y0 (x);
}

Good:

   0x00007ffff7a57140 <+0>:     pxor   %xmm1,%xmm1
   0x00007ffff7a57144 <+4>:     ucomisd %xmm0,%xmm1

mxcsr          0x1f82   [ DE IM DM ZM OM UM PM ]

Bad:

   0x00007ffff7a55624 <+4>:     pxor   %xmm1,%xmm1
   0x00007ffff7a55628 <+8>:     comisd %xmm0,%xmm1

mxcsr          0x1f83   [ IE DE IM DM ZM OM UM PM ]
                          ^^ This is set.

Reply via email to