I might be misremembering, but I think fastmath was one of the flags explicitly warned against in the Gentoo manual.
I might be misremembering, but I think fastmath was one of the flags explicitly warned against in the Gentoo manual.
It is, here: https://wiki.gentoo.org/wiki/GCC_optimization#But_I_get_bett...
Still, there are always (admittedly diminishing) returns if you can target the exact CPU you have - pretty sure no binary distro ever had variants for AMD's TBM instructions [0] but my Gentoo install made use of them (which was made absolutely clear when trying to run any of that on a Zen 2 machine lol).
[0] https://en.wikipedia.org/wiki/X86_Bit_manipulation_instructi...
I've long since stopped worrying about it because on the systems I run, which are not top-of-the-line but aren't RPis either, it's not worth worrying about anymore for most programs. At most maybe you should target the one particular program you use that could use a boost.
Though compiling for the exact CPU was definitely not insignificant before the amd64 switch which gave a new baseline - many distros still targeted i586.
The CPU flags was less interesting to me compared to being able to disable features like X.