News for hackers. Stuff that matters.
Re:How to build highly-debuggable C++ binaries by mgaunard on Tuesday July 30, 2024 @04:49AM (#41107248)
-O3 only breaks your code if it is invalid to begin with.
Re:How to build highly-debuggable C++ binaries by account42 on Tuesday July 30, 2024 @07:10AM (#41107919)
Generally true, but compiler bugs do happen. Still, it's better long-term to report them than spreading FUD about -O3.
Re:How to build highly-debuggable C++ binaries by o11c on Tuesday July 30, 2024 @10:29AM (#41109535)
In theory. In practice, it's not as widely tested and so a lot more bugs survive.

This search is approximate both ways, but still finds a lot of examples of O3 being outright broken:

https://gcc.gnu.org/bugzilla/buglist.cgi?short_desc=O3&resol...

Re:How to build highly-debuggable C++ binaries by mgaunard on Wednesday July 31, 2024 @04:07AM (#41117242)
Most of those bugs are about crashes during compilation or compilation being slow, and also this is 30 years worth of bugs.

Of note, most of those (few) bugs tend to be related to specific language extensions.