3 ms·
True, only executions of a program that exhibit undefined behavior are affected. But the moment it is clear a program will exhibit undefined behavior, the compi
by rocqua 4y ago
True, only executions of a program that exhibit undefined behavior are affected.
But the moment it is clear a program will exhibit undefined behavior, the compiler is already allowed to do whatever it wants. So if 20 lines below an important function call you will certainly call a function that will certainly cause undefined behavior, the important function call can be already be left out.
- dathinab 4y agoAnd the compiler could insert additional side effect free computations ahead of time to detect if an execution will hit UB later on.