[Bug 253847] Printf does not work correctly for denormal doubles on non-x86

bugzilla-noreply at freebsd.org bugzilla-noreply at freebsd.org
Thu Feb 25 14:18:07 UTC 2021


https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=253847

            Bug ID: 253847
           Summary: Printf does not work correctly for denormal doubles on
                    non-x86
           Product: Base System
           Version: CURRENT
          Hardware: Any
                OS: Any
            Status: New
          Severity: Affects Only Me
          Priority: ---
         Component: standards
          Assignee: standards at FreeBSD.org
          Reporter: arichardson at FreeBSD.org

Test code:
```
cat test2.cpp
#include <stdio.h>
#include <limits>

int main() {
        // volatile double x = 0x1p-1537;
        volatile double x = std::numeric_limits<double>::denorm_min();
        printf("x=%g/%a, as long double=%Lg/%La\n", x, x, (long double)x, (long
double)x);
}
```
Output on aarch64
x=0/0x1p-1537, as long double=4.94066e-324/0x1p-1074
Output on amd64:
x=4.94066e-324/0x1p-1074, as long double=4.94066e-324/0x1p-1074

This causes issues with e.g. the msun ldexp test on AArch64.

My guess would be that gdtoa depends on the x86 floating point arithmetic
behaviour.
I also tried updating gdtoa locally, but other than lots of merge conflicts
that did not change anything.

-- 
You are receiving this mail because:
You are the assignee for the bug.


More information about the freebsd-standards mailing list