On Thu, 2025-11-27 at 13:17 +0100, Richard Biener wrote: > On Thu, Nov 27, 2025 at 10:01 AM Xi Ruoyao <[email protected]> wrote: > > > > Current wording may cause people to mistakely believe "hey I use > > -ftrapping-math so GCC should behave as-if it supported FENV_ACCESS > > and > > I enabled it" and add more duplicates of PR 34678. Let's make it > > clear > > such an expectation isn't working. > > There is also dead code elimination. And moving FP operations > across fetestexcept and friends. It's not very well specified what > -ftrapping-math should do here [when optimizing]. Currently it's > main purpose is to ensure no new spurios traps happen when > an alternate exception handling method (raise a signal) is in effect. > > I think a fairer edit would be to remove mentions of FENV_ACCESS from > the option description and instead somewhere else document that > we do not implement FENV_ACCESS.
Indeed, at least we need to change the wording of https://gcc.gnu.org/onlinedocs/gcc/Floating-point-implementation.html: This pragma is not implemented, but the default is to “off” unless - frounding-math is used and -fno-trapping-math is not in which case it is “on”. That falsely implies the default was "on" with -frounding-math -ftrapping- math. It should be changed to something like This pragma is not implemented and GCC always behaves as if it's set to "off"; even if both "-frounding-math" and "-ftrapping-math" are effective, GCC still does not satisfy the requirements when this pragma is set to "on." I'll revise the patch tomorrow. -- Xi Ruoyao <[email protected]>
