Re:Clang vs. Clang
by uecker on Sunday August 04, 2024 @03:40AM
(#41151760)
Why not just turn off (or down) optimizations? I mean, optimization is not even activated by default
[ Parent
| on HN ]
Re:Clang vs. Clang
by andrewaylett on Sunday August 04, 2024 @11:39AM
(#41154221)
Unfortunately it's not necessarily specified what counts as "an optimisation". For example, the (DSP-related) compiler I worked on back in the day had an instruction selection pass, and much of the performance of optimised code came from it being a very good instruction selector. "Turning off optimisations" meant not running compiler passes that weren't required in order to generate code, we didn't have a second sub-optimal instruction selector.
And undefined behaviour is still undefined behaviour without all the optimisation passes turned on.