https://gcc.gnu.org/bugzilla/show_bug.cgi?id=122034
--- Comment #2 from Andrew Pinski <pinskia at gcc dot gnu.org> --- 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.
