https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108596
--- Comment #3 from Jakub Jelinek <jakub at gcc dot gnu.org> --- Likely latent before that though. Slightly cleaned up testcase, just -O2 is needed: __attribute__((__cold__)) void foo (void); void qux (void); int bar (void) { asm goto ("" : : : : l1, l0); l1: return 1; l0: return 0; } void baz () { _Bool x = bar (); if (!x) qux (); foo (); } Or even simpler (again -O2): __attribute__((__cold__)) void foo (void); void bar (void); void baz () { asm goto ("" : : : : l1, l0); goto l0; l1: bar (); l0: foo (); }