aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-ssa-tail-merge.c
diff options
context:
space:
mode:
authorTom de Vries <tom@codesourcery.com>2011-10-19 16:29:42 +0000
committerTom de Vries <vries@gcc.gnu.org>2011-10-19 16:29:42 +0000
commit40f73edd0c35d53f57a1c05b1b4a59c4d7a70d60 (patch)
treefd13fd8833fcb0ab3a3951b41ef2ec73e5cccbf5 /gcc/tree-ssa-tail-merge.c
parent87fb500b9377df6eddfc8efd0b5aa186e075951e (diff)
downloadgcc-40f73edd0c35d53f57a1c05b1b4a59c4d7a70d60.zip
gcc-40f73edd0c35d53f57a1c05b1b4a59c4d7a70d60.tar.gz
gcc-40f73edd0c35d53f57a1c05b1b4a59c4d7a70d60.tar.bz2
re PR tree-optimization/50769 (ICE: in phi_alternatives_equal, at tree-cfgcleanup.c:355 with -O2 -fno-delete-null-pointer-checks -fno-guess-branch-probability -fipa-pta)
2011-10-19 Tom de Vries <tom@codesourcery.com> PR tree-optimization/50769 * tree-ssa-tail-merge.c (replace_block_by): Calculate phi_vuse2 unconditionally. Handle case that phi_vuse2 is not an SSA_NAME. Add dummy argument .MEM to phi when increasing number of arguments of phi by redirecting edges to the block with phi. From-SVN: r180197
Diffstat (limited to 'gcc/tree-ssa-tail-merge.c')
-rw-r--r--gcc/tree-ssa-tail-merge.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/gcc/tree-ssa-tail-merge.c b/gcc/tree-ssa-tail-merge.c
index 529388c..2a47dc6 100644
--- a/gcc/tree-ssa-tail-merge.c
+++ b/gcc/tree-ssa-tail-merge.c
@@ -1508,11 +1508,14 @@ replace_block_by (basic_block bb1, basic_block bb2, bool update_vops)
edge e;
edge_iterator ei;
+ phi_vuse2 = vop_at_entry (bb2);
+ if (phi_vuse2 != NULL_TREE && TREE_CODE (phi_vuse2) != SSA_NAME)
+ phi_vuse2 = NULL_TREE;
+
if (update_vops)
{
/* Find the vops at entry of bb1 and bb2. */
phi_vuse1 = vop_at_entry (bb1);
- phi_vuse2 = vop_at_entry (bb2);
/* If one of the 2 not found, it means there's no need to update. */
update_vops = phi_vuse1 != NULL_TREE && phi_vuse2 != NULL_TREE;
@@ -1545,6 +1548,9 @@ replace_block_by (basic_block bb1, basic_block bb2, bool update_vops)
gcc_assert (pred_edge != NULL);
if (update_vops)
VEC_safe_push (edge, heap, redirected_edges, pred_edge);
+ else if (phi_vuse2 && gimple_bb (SSA_NAME_DEF_STMT (phi_vuse2)) == bb2)
+ add_phi_arg (SSA_NAME_DEF_STMT (phi_vuse2), SSA_NAME_VAR (phi_vuse2),
+ pred_edge, UNKNOWN_LOCATION);
}
/* Update the vops. */