summaryrefslogtreecommitdiff
path: root/gcc/tree-ssa-tail-merge.c
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2016-06-25 19:23:02 +0200
committerJakub Jelinek <jakub@gcc.gnu.org>2016-06-25 19:23:02 +0200
commitf8a06e24da2a52783b3219d61857045d7564d5b6 (patch)
treed4c0505a2e27d3da1b7ef6ccd3ede3e18f45d636 /gcc/tree-ssa-tail-merge.c
parent2a65e70bcfb000b229a2cbf54b06956108443598 (diff)
re PR tree-optimization/71643 (internal compiler error: in redirect_eh_edge_1, at tree-eh.c:2318 after r237427)
PR tree-optimization/71643 * tree-ssa-tail-merge.c (find_clusters_1): Ignore basic blocks with EH preds. * tree-ssa-tail-merge.c (deps_ok_for_redirect_from_bb_to_bb): Don't leak a bitmap if dep_bb is NULL. * g++.dg/opt/pr71643.C: New test. From-SVN: r237783
Diffstat (limited to 'gcc/tree-ssa-tail-merge.c')
-rw-r--r--gcc/tree-ssa-tail-merge.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/gcc/tree-ssa-tail-merge.c b/gcc/tree-ssa-tail-merge.c
index 042d9646b74..5e815ec582a 100644
--- a/gcc/tree-ssa-tail-merge.c
+++ b/gcc/tree-ssa-tail-merge.c
@@ -1398,11 +1398,11 @@ deps_ok_for_redirect_from_bb_to_bb (basic_block from, basic_block to)
basic_block cd, dep_bb = BB_DEP_BB (to);
edge_iterator ei;
edge e;
- bitmap from_preds = BITMAP_ALLOC (NULL);
if (dep_bb == NULL)
return true;
+ bitmap from_preds = BITMAP_ALLOC (NULL);
FOR_EACH_EDGE (e, ei, from->preds)
bitmap_set_bit (from_preds, e->src->index);
cd = nearest_common_dominator_for_set (CDI_DOMINATORS, from_preds);
@@ -1446,7 +1446,7 @@ find_clusters_1 (same_succ *same_succ)
/* TODO: handle blocks with phi-nodes. We'll have to find corresponding
phi-nodes in bb1 and bb2, with the same alternatives for the same
preds. */
- if (bb_has_non_vop_phi (bb1))
+ if (bb_has_non_vop_phi (bb1) || bb_has_eh_pred (bb1))
continue;
nr_comparisons = 0;
@@ -1454,7 +1454,7 @@ find_clusters_1 (same_succ *same_succ)
{
bb2 = BASIC_BLOCK_FOR_FN (cfun, j);
- if (bb_has_non_vop_phi (bb2))
+ if (bb_has_non_vop_phi (bb2) || bb_has_eh_pred (bb2))
continue;
if (BB_CLUSTER (bb1) != NULL && BB_CLUSTER (bb1) == BB_CLUSTER (bb2))