https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110129
--- Comment #4 from Andrew Pinski <pinskia at gcc dot gnu.org> --- (In reply to Andrew Pinski from comment #3) > >Did I miss anything here? Thanks! > > Yes clang is incorrect in removing the infinite loop. > > See bug 94392 comment #3 The loop around via goto is not removable in C11 based on that comment so I am not 100% sure if clang is doing the correct thing but GCC is valid doing the valid thing of not removing it (it is valid to keep the infinite loops in).