Page MenuHomeFreeBSD

Disable -Woverflow errors for i386 for GCC 9.
ClosedPublic

Authored by jhb on Aug 26 2020, 6:45 PM.
Tags
None
Referenced Files
F102430007: D26201.diff
Tue, Nov 12, 4:11 AM
Unknown Object (File)
Sat, Nov 9, 7:28 PM
Unknown Object (File)
Mon, Nov 4, 10:40 PM
Unknown Object (File)
Sun, Nov 3, 7:45 AM
Unknown Object (File)
Sun, Nov 3, 7:43 AM
Unknown Object (File)
Sun, Nov 3, 7:42 AM
Unknown Object (File)
Mon, Oct 28, 2:32 AM
Unknown Object (File)
Oct 7 2024, 8:10 AM

Details

Summary

GCC 9 warns about floating point constants overflowing for i386.

Test Plan
  • build i386 and amd64 with gcc9

Diff Detail

Lint
Lint Skipped
Unit
Tests Skipped
Build Status
Buildable 33177
Build 30526: arc lint + arc unit

Event Timeline

jhb requested review of this revision.Aug 26 2020, 6:45 PM
This revision is now accepted and ready to land.Aug 26 2020, 7:34 PM

There is a larger issue here that GCC has special features in place to deal with the unusual floating point setup FreeBSD/i386 uses. That is what triggers these warnings. clang treats FreeBSD/i386 like Linux i386 and assumes we use the same floating point setup as Linux. Probably we should really change FreeBSD to be more standard to match what clang assumes and let GCC drop patches that are only used on FreeBSD (AFAICT). It would also remove the need for the hack to not install GCC's float.h for amd64 and i386.

Is there a canonical reference for these differences?

Is this specifically for LDBL_MAX?

When I looked at something like this last (around r323003), gcc wasn't just producing a warning, it was also producing wrong code (an infinite value instead of a finite one).

Going to a more sane long double for i386 would be great, but might have some ABI/upgrade consequences.

jhb retitled this revision from Disabling -Woverflow errors for i386 for GCC 9. to Disable -Woverflow errors for i386 for GCC 9..Sep 13 2021, 3:50 PM
This revision was automatically updated to reflect the committed changes.