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: Thu, 9 Jan 2014 13:30:53 +0100 (CET)
- Subject: Re: [PATCH] Fix devirtualization ICE (PR tree-optimization/59622, take 3)
- Authentication-results: sourceware.org; auth=none
- References: <alpine dot LSU dot 2 dot 11 dot 1401081203410 dot 4623 at zhemvz dot fhfr dot qr> <alpine dot LSU dot 2 dot 11 dot 1401081213260 dot 4623 at zhemvz dot fhfr dot qr> <20140108111813 dot GE892 at tucnak dot redhat dot com> <alpine dot LSU dot 2 dot 11 dot 1401081218500 dot 4623 at zhemvz dot fhfr dot qr> <20140108224457 dot GQ892 at tucnak dot redhat dot com> <alpine dot LSU dot 2 dot 11 dot 1401090943520 dot 4623 at zhemvz dot fhfr dot qr> <20140109110935 dot GW892 at tucnak dot redhat dot com> <alpine dot LSU dot 2 dot 11 dot 1401091212180 dot 4623 at zhemvz dot fhfr dot qr> <20140109111854 dot GY892 at tucnak dot redhat dot com> <alpine dot LSU dot 2 dot 11 dot 1401091230240 dot 4623 at zhemvz dot fhfr dot qr> <20140109120657 dot GZ892 at tucnak dot redhat dot com>
On Thu, 9 Jan 2014, Jakub Jelinek wrote:
> On Thu, Jan 09, 2014 at 12:31:47PM +0100, Richard Biener wrote:
> > On Thu, 9 Jan 2014, Jakub Jelinek wrote:
> >
> > > On Thu, Jan 09, 2014 at 12:15:00PM +0100, Richard Biener wrote:
> > > > > Well, then the __cxa_pure_virtual testcases ICE again, but the pr59622-5.C
> > > > > testcase ICEs anyway, so here is a different patch (untested so far except
> > > > > for the tests). The issue with the calls is that when fold_stmt is done
> > > > > during gimplification (or omp lowering), we don't have cfg nor SSA form and
> > > > > nothing performs fixup_noreturn_calls (that function requires CFG and SSA
> > > > > form anyway). So, we have to fix that up by hand, but as we aren't in SSA
> > > > > form yet, dropping lhs is always safe for the noreturn calls.
> > > >
> > > > Don't we "fix this up" during CFG build?
> > >
> > > Sure, we do, but we ICE far before we get there.
> > > #0 error (gmsgid=0x1613b69 "LHS in noreturn call") at ../../gcc/diagnostic.c:1041
> > > #1 0x0000000000d64c7b in verify_gimple_call (stmt=<gimple_call 0x7ffff1a2b000>) at ../../gcc/tree-cfg.c:3149
> > > #2 0x0000000000d68e0f in verify_gimple_stmt (stmt=<gimple_call 0x7ffff1a2b000>) at ../../gcc/tree-cfg.c:4323
> > > #3 0x0000000000d69430 in verify_gimple_in_seq_2 (stmts=0x7ffff1a232d0) at ../../gcc/tree-cfg.c:4490
> > > #4 0x0000000000d69502 in verify_gimple_in_seq (stmts=0x7ffff1a232d0) at ../../gcc/tree-cfg.c:4520
> > > #5 0x0000000000af3806 in gimplify_body (fndecl=<function_decl 0x7ffff1a0da00 baz>, do_parms=true) at ../../gcc/gimplify.c:8599
> > > #6 0x0000000000af3c40 in gimplify_function_tree (fndecl=<function_decl 0x7ffff1a0da00 baz>) at ../../gcc/gimplify.c:8684
> >
> > So what fixes it for
> >
> > int __attribute__((noreturn)) foo () {}
> > int main()
> > {
> > return foo ();
> > }
> >
> > ?
>
> gimplify_modify_expr has:
>
> if (!gimple_call_noreturn_p (assign))
> gimple_call_set_lhs (assign, *to_p);
Ok, it seems to be too early then - move it after the folding.
Richard.
- References:
- Re: [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)
- Re: [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)
- Re: [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)
- Re: [PATCH] Fix devirtualization ICE (PR tree-optimization/59622, take 3)
- Re: [PATCH] Fix devirtualization ICE (PR tree-optimization/59622, take 3)