https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82602
David Brown <david at westcontrol dot com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |david at westcontrol dot com --- Comment #2 from David Brown <david at westcontrol dot com> --- For reference, the issue is also discussed here: https://bugs.launchpad.net/gcc-arm-embedded/+bug/1722849 For this particular case, there are usable workarounds (with extra dependencies or memory clobbers). But "asm volatile" statements should not be moveable across other asm volatile statements, volatile memory accesses, or other observable behaviour. (It is fine that they can be moved across other code, just like other volatile accesses.)