4 ms·
-O3 only breaks your code if it is invalid to begin with.
by mgaunard 2y ago
-O3 only breaks your code if it is invalid to begin with.
- account42 2y agoGenerally true, but compiler bugs do happen. Still, it's better long-term to report them than spreading FUD about -O3.
- o11c 2y agoIn 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&resolution=---&resolution=FIXED&order=Importance&query_format=advanced&bug_status=ASSIGNED&bug_status=RESOLVED&bug_status=VERIFIED&short_desc_type=allwordssubstr&cf_known_to_work_type=allwords&cf_known_to_fail_type=allwords https://gcc.gnu.org/bugzilla/buglist.cgi?short_desc=O3&resol...
- mgaunard 2y agoMost 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.