https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94165
Jakub Jelinek <jakub at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |jakub at gcc dot gnu.org --- Comment #1 from Jakub Jelinek <jakub at gcc dot gnu.org> --- This warning is an early warning (during gimplification) and can handle only some constructs that clearly can't fall thru. E.g. we do warn for: extern void foo (const char *) __attribute__((noreturn)); int bar (int x) { switch (x) { default: foo ("bug"); x++; case 1: return x + 2; } } but if you take the unreachable code after the noreturn call, we won't warn. The expression statement is similar, there is code after the noreturn call. Finding noreturn stuff in the middle of sequences would be difficult and expensive. Only the cfg pass is then able to figure out that some code is unreachable.