https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91812
--- Comment #2 from Gregory Fuchedzhy <fuchedzhy at google dot com> --- (In reply to Eric Gallager from comment #1) > If you declare ptr like this instead, the assembly comes out looking > different: > volatile unsigned int *volatile ptr; Even seemingly unrelated code changes can hide this behavior. For example, commenting out one of switch cases generates correct assembly.