This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Fix devirtualization ICE (PR tree-optimization/59622, take 3)
- From: Richard Biener <rguenther at suse dot de>
- To: Jakub Jelinek <jakub at redhat dot com>
- Cc: Jan Hubicka <hubicka at ucw dot cz>, gcc-patches at gcc dot gnu dot org
- Date: Wed, 8 Jan 2014 12:10:55 +0100 (CET)
- Subject: Re: [PATCH] Fix devirtualization ICE (PR tree-optimization/59622, take 3)
- Authentication-results: sourceware.org; auth=none
- References: <20140103094203 dot GY892 at tucnak dot redhat dot com> <alpine dot LSU dot 2 dot 11 dot 1401031100040 dot 16201 at zhemvz dot fhfr dot qr> <20140103100809 dot GA892 at tucnak dot redhat dot com> <alpine dot LSU dot 2 dot 11 dot 1401031110480 dot 16201 at zhemvz dot fhfr dot qr> <20140103101824 dot GC892 at tucnak dot redhat dot com> <alpine dot LSU dot 2 dot 11 dot 1401031118360 dot 16201 at zhemvz dot fhfr dot qr> <alpine dot LSU dot 2 dot 11 dot 1401031123090 dot 16201 at zhemvz dot fhfr dot qr> <20140103103350 dot GE892 at tucnak dot redhat dot com> <20140107172336 dot GX892 at tucnak dot redhat dot com> <alpine dot LSU dot 2 dot 11 dot 1401081141510 dot 4623 at zhemvz dot fhfr dot qr> <20140108105438 dot GD892 at tucnak dot redhat dot com>
On Wed, 8 Jan 2014, Jakub Jelinek wrote:
> On Wed, Jan 08, 2014 at 11:45:28AM +0100, Richard Biener wrote:
> > I prefer to always do this, not do the fancy insertion-before. That
> > would do repeated folding for
> >
> > fold_stmt (gsi);
> > fold_stmt (gsi);
> > fold_stmt (gsi);
> >
> > where the last two should be a no-op.
>
> I don't see how is that possible, at least for the __builtin_unreachable
> case, because by just setting the fndecl to __builtin_unreachable and
> keeping the incompatible fntype and bogus arguments for it all the
> predicates whether it is a valid/suitable builtin call will fail and we
> don't have a __builtin_unreachable function you could call.
Well, that just means we need two sets of predicates to check for
a builtin call. The __builtin_unreachable code wants to know what
the callee is, not if that's a "valid" call to it. But yeah - this
starts to get confusing :/
> So at least for builtin we want to make sure it has the right parameters.
> If the lhs is something we can just initialize to zero, we can replace the
> call with zeroing the lhs, but that is no the case always.
I start to think this is a too complex transform for stmt folding ...
> For __cxa_pure_virtual we could just keep the code as is (just with the
> !inplace addition and spelling fix?), but would need to fix up whatever ICEs
> during checking on it to honor fntype rather than decl's type.
Yes.
So a patch just keeping the targets.length () == 1 case in folding
with just replacing the fndecl of the call is ok.
Thanks,
Richard.
- References:
- Re: [PATCH] Fix devirtualization ICE (PR tree-optimization/59622, take 2)
- Re: [PATCH] Fix devirtualization ICE (PR tree-optimization/59622, take 2)
- Re: [PATCH] Fix devirtualization ICE (PR tree-optimization/59622, take 2)
- Re: [PATCH] Fix devirtualization ICE (PR tree-optimization/59622, take 2)
- Re: [PATCH] Fix devirtualization ICE (PR tree-optimization/59622, take 2)
- Re: [PATCH] Fix devirtualization ICE (PR tree-optimization/59622, take 2)
- Re: [PATCH] Fix devirtualization ICE (PR tree-optimization/59622, take 2)
- Re: [PATCH] Fix devirtualization ICE (PR tree-optimization/59622, take 2)
- [PATCH] Fix devirtualization ICE (PR tree-optimization/59622, take 3)
- Re: [PATCH] Fix devirtualization ICE (PR tree-optimization/59622, take 3)
- Re: [PATCH] Fix devirtualization ICE (PR tree-optimization/59622, take 3)