4 ms·
> And specifically for C, unsafe optimizations are supposed to only apply with -O3. Level 2 is supposed to be safe. Citation needed? AIUI optimization levels
by foxfluff 5y ago
> And specifically for C, unsafe optimizations are supposed to only apply with -O3. Level 2 is supposed to be safe.
Citation needed? AIUI optimization levels are entirely up to the compiler. GCC's man page says nothing about the safety of these levels.
> Optimizations aren't supposed to change the meaning of your code.
And they generally won't. The trouble is when the meaning of your code wasn't well defined to begin with (or you thought it meant something it didn't).
- marcosdumay 5y ago> GCC's man page says nothing about the safety of these levels. Well, it used to.