2 ms·
There's actually a pretty simple way to determine whether the compiler is relying on undefined behavior for optimization. Simply evaluate the following two crit
by mikeash 12y ago
There's actually a pretty simple way to determine whether the compiler is relying on undefined behavior for optimization. Simply evaluate the following two criteria:
1. Are you using a C compiler?
2. Are optimizations enabled?
If the answer to both of these is "yes", then the compiler is almost certainly relying on undefined behavior for optimization.