4 ms·
When you write it like that, it sounds insane. But it's very far from how compilers work. There is nothing like "find UB, then take advantage of it", it's compl
by kzrdude 5y ago
When you write it like that, it sounds insane. But it's very far from how compilers work. There is nothing like "find UB, then take advantage of it", it's completely inverted.
The normal rules the optimizer works from assume there is no UB. It's just always the normal rules, and they work the same way for all programs.
MichaelBurge's comment has illustrated this better than I could.