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

            Bug ID: 118184
           Summary: [15 regression] glibc regression on aarch64
           Product: gcc
           Version: 15.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: tree-optimization
          Assignee: unassigned at gcc dot gnu.org
          Reporter: adhemerval.zanella at linaro dot org
  Target Milestone: ---

Created attachment 59957
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=59957&action=edit
preprocessed file of the affected routine

The commit
https://gcc.gnu.org/git/?p=gcc.git;a=commitdiff;h=5ab3f091b3eb42795340d3c9cea8aaec2060693c
triggered two glibc regression on aarch64:

FAIL: math/test-nan-payload
FAIL: stdlib/tst-strtod6

On glibc stdlib/strtod_nan_main.c where glibc handles the NaN input for
strtold:

 48   /* This is a system-dependent way to specify the bitmask used for
 49      the NaN.  We expect it to be a number which is put in the
 50      mantissa of the number.  */
 51   STRING_TYPE *endp;
 52   unsigned long long int mant;
 53
 54   int save_errno = errno;
 55   mant = STRTOULL (str, &endp, 0);
 56   __set_errno (save_errno);
 57   if (endp == cp)
 58     SET_NAN_PAYLOAD (retval, mant);
 59
 60  out:
 61   if (endptr != NULL)
 62     *endptr = (STRING_TYPE *) cp;
 63   return retval;
 64 }

When building with default -O2 the comparison at line 57 is not true, which
does not net the number to NaN. Building with -O0 does not trigger this issue.

Reply via email to