On 14/07/2021 09:49, Matthias Kretz wrote: > On Wednesday, 14 July 2021 09:39:42 CEST Richard Biener wrote: >> -ffast-math decomposes to quite some flag_* and those generally are not >> reflected into the IL but can be different per function (and then >> prevent inlining). > > Is there any chance the "and then prevent inlining" can be eliminated? > Because > then I could write my own fast<float> class in C++, marking all operators > with > __attribute__((optimize("-Ofast")))... >
You can add your voice to <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101279>. I think there is a lot of scope for improved code in general if function attributes did not disable inlining in so many cases. And it would open the possibility of C++ template classes to let programmers mix and match "fast" floating point vs. strict IEEE, or different overflow behaviour, or different trapping behaviour - without the overhead of function calls ruining the whole idea. But it is a tough challenge for the gcc developers, and would (as far as my limited understanding goes) involve a lot of changes the to the way the compiler works. I expect it is something that would need to be done as a project rather than just a few patches.