https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87639
--- Comment #2 from Rich Felker <bugdal at aerifal dot cx> --- While I'd love to see it fixed via shrink-wrappping, which would fix lots of other excessive stack usage issues too, like: if (last_recursion_level) { char buf[1000]; /* code that needs buf */ } else { /* code that doesn't need buf */ } I don't think this is necessary for a fix. It should be possible to update whatever predicate checks for sibcall eligibility based on having leaked address of objects on the stack to exclude those whose block lifetime has ended, without actually going to the trouble of making gcc explicitly free their stack allocations.