On Mon, 29 Jun 2020, Richard Biener via Gcc-patches wrote:

At least without -frounding-math fegetround could be
constant folded to FE_TONEAREST for which we'd need the
actual value of FE_TONEAREST.

That will break existing code which, since -frounding-math doesn't work for that, protects all FP operations with volatile read/writes or similar asm, and then doesn't specify -frounding-math because it doesn't seem necessary. I am not saying that code is right, just that it exists.

In a world where we have implemented fenv_access, this kind of folding of fegetround could only happen in "#pragma fenv_access off" regions, which seems to imply that it would be the front-end's responsibility (although it would need help from the back-end to know the default value to fold to).

--
Marc Glisse

Reply via email to