https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96565
--- Comment #7 from rguenther at suse dot de <rguenther at suse dot de> --- On Tue, 25 Aug 2020, jakub at gcc dot gnu.org wrote: > https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96565 > > --- Comment #5 from Jakub Jelinek <jakub at gcc dot gnu.org> --- > Wouldn't many spots in the middle-end be upset about the gimple clobber having > a variable length type (both the MEM_REF on the lhs and corresponding type on > the CONSTRUCTOR)? Well, it of course would need to be wrapped in a WITH_SIZE_EXPR (ick). Maybe we can clobber the original VAR_DECL ... > I think tree DCE should have everything it needs for the removals even without > such CLOBBERs, except that it is harder but not impossible to find out which > __builtin_stack_restore frees what. I'm not sure we can do this, that is, treat __builtin_stack_restore as "free". What we can possibly do is avoid treating __builtin_stack_restore as use (but we still need to consider it clobbering things). That is, fixing ref_maybe_used_by_stmt_p should be possible but stmt_kills_ref_p is way harder. Let me see if I can do ref_maybe_used_by_stmt_p.