You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
-O3 for GCC is explicitly unsafe, enabling - among other things - non-standards compliant floating point maths.
Given what's being discussed here, why is -O3 being suggested as a good idea? -O2 or -Os are usually much safer.
Compiling with -O3 is not a guaranteed way to improve performance, and in fact in many cases can slow down a system due to larger binaries and increased memory usage. -O3 is also known to break several packages. Therefore, using -O3 is not recommended.
A better, safer option for local builds is -O2 -march=native -mtune=native, possibly also with -flto.
The text was updated successfully, but these errors were encountered:
I'm very late, but you appear to confuse -O3 (standards compliant) with -Ofast (explicitly non-standards compliant). -O3 is entirely safe providing your code is correct. Packages sometimes break with -O3 because they are not correct, and the analysis at -O3 can prove as such.
For modern, new programs there is very little reason to prefer -O2 over -O3 unless you're doing very hairy things with templates, especially because the more detailed flow analysis of -O3 can produce warnings (find bugs) that -O2 does not.
...very late also, but I believe you are correct. I was remembering warnings not to use -O3 because a lot of code is not correct, and hasn't been fixed.
-O3 for GCC is explicitly unsafe, enabling - among other things - non-standards compliant floating point maths.
Given what's being discussed here, why is -O3 being suggested as a good idea? -O2 or -Os are usually much safer.
A better, safer option for local builds is
-O2 -march=native -mtune=native
, possibly also with-flto
.The text was updated successfully, but these errors were encountered: