On Fri, Mar 17, 2017 at 02:42:27PM +0100, Richard Biener wrote: > 2017-03-17 Richard Biener <rguent...@suse.de> > > PR tree-optimization/80032 > * gimplify.c (gimple_push_cleanup): Add force_uncond parameter, > if set force the cleanup to happen unconditionally. > (gimplify_target_expr): Push inserted clobbers with force_uncond > to avoid them being removed by control-dependent DCE. > > * g++.dg/opt/pr80032.C: New testcase. > > ! if (gimple_conditional_context () > ! && ! force_uncond)
This ought to fit on one line. Otherwise it looks good to me. Does the https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80032#c8 regression happen with this patch or the earlier version of the patch? > --- gcc/testsuite/g++.dg/opt/pr80032.C (nonexistent) > +++ gcc/testsuite/g++.dg/opt/pr80032.C (working copy) > @@ -0,0 +1,121 @@ > +// PR tree-optimization/80032 > +/* { dg-do compile } */ > +/* { dg-require-effective-target c++11 } */ > +/* { dg-options "-O2" } */ It is weird to mix // and /* */ comments, better just pick one style. Also, // { dg-do compile { target c++11 } } is perhaps simpler. > +/* If DCE removes too many CLOBBERs then stack usage goes through the > + roof as stack slots can no longer be shared. */ > +/* { dg-additional-options "-Wstack-usage=200" { target x86_64-*-* i?86-*-* > } } */ Jakub