https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90329
--- Comment #30 from Thomas Koenig <tkoenig at gcc dot gnu.org> --- Hi Jakub, > Untested workaround that isn't a too big hammer. This should just avoid > tail calls in functions where the hidden string arguments for > character(len=constant) dummy arguments are passed partially or fully on the > stack and the callee needs to pass anything on the stack and thus might > clobber that. Thanks for taking this on! Two remarks: It should be possible to have this workaround in place only when there is no explicit interface for the called routine. No need to penalize modern, correct Fortran for this. I can look at this, but I will only be able to find time on the weekend. And I would like to have the Fortran part behind an option, so people could disable this pessimization if they start using the correct prototypes. Ideally, the compiler could warn about this. It already does so if you use -flto, but without LTO, the warning would have to be emitted from the C compiler, and I see no even halfway sane way of doing it.