https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64996
Marek Polacek <mpolacek at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |RESOLVED CC| |mpolacek at gcc dot gnu.org Resolution|--- |INVALID --- Comment #1 from Marek Polacek <mpolacek at gcc dot gnu.org> --- Since the variable is unused, we get rid of it, and then DCE removes the ubsan check. I don't think it is a bug. Adding asm ("" : "+g" (i)); after the decrement makes the runtime error appear again.