Bug 82733 - [8 regression] FAIL: math/test-double-y0 (with qNaN input)
Summary: [8 regression] FAIL: math/test-double-y0 (with qNaN input)
Status: RESOLVED DUPLICATE of bug 82692
Alias: None
Product: gcc
Classification: Unclassified
Component: target (show other bugs)
Version: 8.0
: P3 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-10-26 11:02 UTC by H.J. Lu
Modified: 2017-10-26 11:29 UTC (History)
1 user (show)

See Also:
Host:
Target: x86
Build:
Known to work:
Known to fail:
Last reconfirmed: 2017-10-26 00:00:00


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description H.J. Lu 2017-10-26 11:02:08 UTC
On x86, GCC 8 r254052 caused:

FAIL: math/test-double-y0
FAIL: math/test-double-y1
FAIL: math/test-double-yn
FAIL: math/test-float-y0
FAIL: math/test-float-y1
FAIL: math/test-float-yn
FAIL: math/test-ldouble-y0
FAIL: math/test-ldouble-y1

in glibc testsuite.  The failure looks like:

testing double (without inline functions)
Failure: y0 (qNaN): Exception "Invalid operation" set
Failure: y0 (-qNaN): Exception "Invalid operation" set
Failure: y0_downward (qNaN): Exception "Invalid operation" set
Failure: y0_downward (-qNaN): Exception "Invalid operation" set
Failure: y0_towardzero (qNaN): Exception "Invalid operation" set
Failure: y0_towardzero (-qNaN): Exception "Invalid operation" set
Failure: y0_upward (qNaN): Exception "Invalid operation" set
Failure: y0_upward (-qNaN): Exception "Invalid operation" set
Comment 1 H.J. Lu 2017-10-26 11:23:57 UTC
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.
Comment 2 H.J. Lu 2017-10-26 11:27:12 UTC
This may be caused by r253986.
Comment 3 Uroš Bizjak 2017-10-26 11:29:29 UTC
Dup.

*** This bug has been marked as a duplicate of bug 82692 ***