https://gcc.gnu.org/bugzilla/show_bug.cgi?id=112601
--- Comment #4 from Sergei Trofimovich <slyfox at gcc dot gnu.org> --- Cloud also get rid of all the globals: static void printChar() {} static void emit(void Print()) { Print(); } struct S { __attribute__((noinline)) static void sm() { emit(printChar); } }; void run() { S::sm(); }