https://gcc.gnu.org/bugzilla/show_bug.cgi?id=122034
--- Comment #3 from Richard Biener <rguenth at gcc dot gnu.org> --- (In reply to Andrew Pinski from comment #2) > I was thinking about doing this in DCE rather than a secondary pass. Though > I have to figure out the best way to mark __builtin_stack_save is alive when > an alloca happens because unlike malloc/free, there is no tracking of return > values here. It's indeed not the very best representation for analyses. There's also the interaction between turning alloca with constant size into DECLs and a wrapping stack save/restore. There we might even hoist/sink uses of the decl outside of the original save/restore pair (that's not incorrect, it's just undesirable).