https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82296
Markus Trippelsdorf <trippels at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |trippels at gcc dot gnu.org --- Comment #4 from Markus Trippelsdorf <trippels at gcc dot gnu.org> --- (In reply to Ingo from comment #3) > And just because there is this paragraph in the C language specification, > the compiler is then allowed to produce "random" code ? Yes. The compiler assumes that undefined behavior is never invoked and optimizes accordingly. This is nothing new. If you need hand-holding use the sanitizers.