This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Fix PR80032 - handle CLOBBER gimplification differently
- From: Richard Biener <rguenther at suse dot de>
- To: Jakub Jelinek <jakub at redhat dot com>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Tue, 21 Mar 2017 09:24:01 +0100 (CET)
- Subject: Re: [PATCH] Fix PR80032 - handle CLOBBER gimplification differently
- Authentication-results: sourceware.org; auth=none
- References: <alpine.LSU.2.20.1703171356130.30051@zhemvz.fhfr.qr> <20170320174306.GL11094@tucnak>
On Mon, 20 Mar 2017, Jakub Jelinek wrote:
> On Fri, Mar 17, 2017 at 02:42:27PM +0100, Richard Biener wrote:
> > 2017-03-17 Richard Biener <rguenther@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?
With the DCE patch only.
> > --- 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-*-* } } */
I'll adjust and commit.
Thanks,
Richard.