This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: Remove unused arguments of bulitin_unreachable
- From: Martin Jambor <mjambor at suse dot cz>
- To: Jan Hubicka <hubicka at ucw dot cz>
- Cc: Jakub Jelinek <jakub at redhat dot com>, gcc-patches at gcc dot gnu dot org, rguenther at susu dot de
- Date: Thu, 11 Dec 2014 22:05:18 +0100
- Subject: Re: Remove unused arguments of bulitin_unreachable
- Authentication-results: sourceware.org; auth=none
- References: <20141211170655 dot GA28396 at kam dot mff dot cuni dot cz> <20141211171312 dot GR1667 at tucnak dot redhat dot com> <20141211181643 dot GA17478 at kam dot mff dot cuni dot cz>
Hi,
On Thu, Dec 11, 2014 at 07:16:43PM +0100, Jan Hubicka wrote:
> > On Thu, Dec 11, 2014 at 06:06:55PM +0100, Jan Hubicka wrote:
> > > Hi,
> > > in firefox .optimized dumps one can see few places where __builtin_unreachable
> > > is called (as a result of devirtualization code proving the code path to be
> > > undefined). There is usually some argument setup for the parameters of
> > > __builtin_unreachable that are dead. This patch makes it somewhat better
> > > so now we get:
> > > <bb 30>:
> > > # prephitmp_222 = PHI <_52(27), pretmp_245(29)>
> > > _57 = prephitmp_222 + 2;
> > > pool_40(D)->ptr = _57;
> > > __builtin_unreachable ();
> > >
> > > Why DSE does not eliminate the stores prior noreturn const function?
> > >
> > > Bootstrapped/regtested x86_64-linux, OK?
> > >
> > > Honza
> > > * tree-ssa-dce.c (mark_stmt_if_obviously_necessary): Remove dead parameters
> > > of BUILT_IN_UNREACHABLE
> >
> > Shouldn't this be done when you actually change the call to
> > __builtin_unreachable ()? I mean, __builtin_unreachable () has no
> > arguments, so leaving any arguments there is broken IL, even if you clean it
> > up during the next DCE.
>
> Hmm, I tought there was some reason to not do so becuase of inplace folding and memory-SSA.
> I can give a try to update all the places we can put builtin_unreachable into IL.
> (I wonder if that also include standard constant propagation)
I think that's what we ought to do, see also PR 61591.
Martin