aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-call-cdce.c
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2013-08-16 10:57:29 +0200
committerJakub Jelinek <jakub@gcc.gnu.org>2013-08-16 10:57:29 +0200
commit7a46059462cd49f3304fe42437b94697a50e9bed (patch)
tree7f31af965b645ebdcb9d744c3b6c16a68d013604 /gcc/tree-call-cdce.c
parenta23d240db06c29b02b1ad1668a36f455cdbb7902 (diff)
downloadgcc-7a46059462cd49f3304fe42437b94697a50e9bed.zip
gcc-7a46059462cd49f3304fe42437b94697a50e9bed.tar.gz
gcc-7a46059462cd49f3304fe42437b94697a50e9bed.tar.bz2
re PR regression/58165 (internal compiler error: verify_flow_info)
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. From-SVN: r201780
Diffstat (limited to 'gcc/tree-call-cdce.c')
-rw-r--r--gcc/tree-call-cdce.c23
1 files changed, 18 insertions, 5 deletions
diff --git a/gcc/tree-call-cdce.c b/gcc/tree-call-cdce.c
index 8edcad9..1396388 100644
--- a/gcc/tree-call-cdce.c
+++ b/gcc/tree-call-cdce.c
@@ -726,15 +726,28 @@ shrink_wrap_one_built_in_call (gimple bi_call)
return false and do not do any transformation for
the call. */
if (nconds == 0)
- return false;
+ {
+ conds.release ();
+ return false;
+ }
bi_call_bb = gimple_bb (bi_call);
- /* Now find the join target bb -- split
- bi_call_bb if needed. */
- bi_call_bsi = gsi_for_stmt (bi_call);
+ /* Now find the join target bb -- split bi_call_bb if needed. */
+ if (stmt_ends_bb_p (bi_call))
+ {
+ /* If the call must be the last in the bb, don't split the block,
+ it could e.g. have EH edges. */
+ join_tgt_in_edge_from_call = find_fallthru_edge (bi_call_bb->succs);
+ if (join_tgt_in_edge_from_call == NULL)
+ {
+ conds.release ();
+ return false;
+ }
+ }
+ else
+ join_tgt_in_edge_from_call = split_block (bi_call_bb, bi_call);
- join_tgt_in_edge_from_call = split_block (bi_call_bb, bi_call);
bi_call_bsi = gsi_for_stmt (bi_call);
join_tgt_bb = join_tgt_in_edge_from_call->dest;