https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97831
--- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> --- I can think of a simple way disabling tail calls: static void disabletailcallfunc(void*) __attribute__((noipa)); static void disabletailcallfunc(void *x){} #define disabletailcall() do {int a; disabletailcallfunc(&a);}while(0); int functionwhichIwantToDisableTailCallFrom(...) { disabletailcall(); } The overhead for this extra variable and call is small in terms of things.