https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81715
--- Comment #3 from Arnd Bergmann <arnd at linaro dot org> --- (In reply to Arnd Bergmann from comment #2) > Created attachment 42178 [details] > preprocessed linux/drivers/media/dvb-frontends/stv090x.c, compressed > > This is one of the typical files showing the behavior, with stack sizes up > to 8 KB using gcc, but only a few hundred bytes using clang: > Looking at it again, it was probably not the best example, in this case the difference between clang and gcc is that clang happens to inline stv090x_write_regs while gcc doesn't inline it. If I mark that function as __always_inline, gcc produces good code as well, but that is a little besides the point. In a lot of other examples the function that gets called is from another file, so we can't inline it. I can attach a few other examples if that helps, or you could just replace the function with an extern declaration for testing.