Summary: | [4.8/4.9 regression] internal compiler error: verify_flow_info | ||
---|---|---|---|
Product: | gcc | Reporter: | Alexander Ivchenko <aivchenk> |
Component: | regression | Assignee: | Jakub Jelinek <jakub> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | jakub |
Priority: | P3 | ||
Version: | 4.8.0 | ||
Target Milestone: | 4.8.2 | ||
Host: | Target: | ||
Build: | Known to work: | ||
Known to fail: | Last reconfirmed: | 2013-08-15 00:00:00 | |
Attachments: |
gcc49-pr58165.patch
gcc49-pr58165.patch |
Description
Alexander Ivchenko
2013-08-15 07:00:40 UTC
>The guilty revision is:
No that just exposed the bug.
Sounds like call-cdce bug to me. Reduced testcase: extern "C" float sqrtf (float); struct A { A (); ~A (); }; void foo (double d) { A a; sqrtf (d); } Created attachment 30661 [details] gcc49-pr58165.patch Untested fix. I firstly did something like that: diff --git a/gcc/tree-call-cdce.c b/gcc/tree-call-cdce.c index 9b6186e..5862ebf 100644 --- a/gcc/tree-call-cdce.c +++ b/gcc/tree-call-cdce.c @@ -771,6 +771,9 @@ shrink_wrap_one_built_in_call (gimple bi_call) join_tgt_in_edge_fall_thru = make_edge (guard_bb0, join_tgt_bb, EDGE_FALSE_VALUE); + if (!gimple_call_nothrow_p (bi_call)) + make_eh_edges (bi_call); + bi_call_in_edge0->probability = REG_BR_PROB_BASE * ERR_PROB; bi_call_in_edge0->count = apply_probability (guard_bb0->count, which also helped.. but now I see that we shouldn't split the block (In reply to Alexander Ivchenko from comment #4) > I firstly did something like that: > > diff --git a/gcc/tree-call-cdce.c b/gcc/tree-call-cdce.c > index 9b6186e..5862ebf 100644 > --- a/gcc/tree-call-cdce.c > +++ b/gcc/tree-call-cdce.c > @@ -771,6 +771,9 @@ shrink_wrap_one_built_in_call (gimple bi_call) > join_tgt_in_edge_fall_thru = make_edge (guard_bb0, join_tgt_bb, > EDGE_FALSE_VALUE); > > + if (!gimple_call_nothrow_p (bi_call)) > + make_eh_edges (bi_call); > + > bi_call_in_edge0->probability = REG_BR_PROB_BASE * ERR_PROB; > bi_call_in_edge0->count = > apply_probability (guard_bb0->count, > > which also helped.. but now I see that we shouldn't split the block Well, that wouldn't be sufficient, you'd need to also remove the EH edges from the other bb. But not splitting the block means you don't have to bother with that. Though, thinking about it again, my patch might be problematic for -fcompare-debug, because we could be not splitting without -g and for -g if a call is followed by some debug stmts, we could be splitting. So, I need to use stmt_ends_bb_p instead. Created attachment 30662 [details] gcc49-pr58165.patch Updated patch.
> Well, that wouldn't be sufficient, you'd need to also remove the EH edges
> from the other bb. But not splitting the block means you don't have to
> bother with that.
Well, that's true. We could do that and not give up on cdce, but I guess there is no much profit in that..
Your fix works for me and the initial issue with bullet lib is also cured (and reduced testcase shows the problem as well). Thanks =)
Author: jakub Date: Fri Aug 16 08:57:29 2013 New Revision: 201780 URL: http://gcc.gnu.org/viewcvs?rev=201780&root=gcc&view=rev Log: PR tree-optimization/58165 * tree-call-cdce.c (shrink_wrap_one_built_in_call): If bi_call must be the last stmt in a bb, don't split_block, instead use fallthru edge from it and give up if there is none. Release conds vector when returning early. * g++.dg/opt/pr58165.C: New test. Added: trunk/gcc/testsuite/g++.dg/opt/pr58165.C Modified: trunk/gcc/ChangeLog trunk/gcc/testsuite/ChangeLog trunk/gcc/tree-call-cdce.c Author: jakub Date: Fri Aug 16 09:04:52 2013 New Revision: 201781 URL: http://gcc.gnu.org/viewcvs?rev=201781&root=gcc&view=rev Log: PR tree-optimization/58165 * tree-call-cdce.c (shrink_wrap_one_built_in_call): If bi_call must be the last stmt in a bb, don't split_block, instead use fallthru edge from it and give up if there is none. Release conds vector when returning early. * g++.dg/opt/pr58165.C: New test. Added: branches/gcc-4_8-branch/gcc/testsuite/g++.dg/opt/pr58165.C Modified: branches/gcc-4_8-branch/gcc/ChangeLog branches/gcc-4_8-branch/gcc/testsuite/ChangeLog branches/gcc-4_8-branch/gcc/tree-call-cdce.c |