aboutsummaryrefslogtreecommitdiff
path: root/gcc/gimple-fold.c
diff options
context:
space:
mode:
authorMichael Matz <matz@suse.de>2010-06-30 16:34:22 +0000
committerMichael Matz <matz@gcc.gnu.org>2010-06-30 16:34:22 +0000
commit8a1561bcd07c8e630f1e7492c364a664dd6f3d69 (patch)
tree2852023f84692231142ea669a9e5ceed97a70395 /gcc/gimple-fold.c
parent6b180c51344c45d4b0b4a792de68b634f4a354cd (diff)
downloadgcc-8a1561bcd07c8e630f1e7492c364a664dd6f3d69.zip
gcc-8a1561bcd07c8e630f1e7492c364a664dd6f3d69.tar.gz
gcc-8a1561bcd07c8e630f1e7492c364a664dd6f3d69.tar.bz2
re PR bootstrap/44699 (Bootstrap failure for x86_64-apple-darwin10: ICE while compiling genmodes.c)
PR bootstrap/44699 * tree-vrp.c (vrp_finalize): Deal with changing num_ssa_names. * gimple-fold.c (gimplify_and_update_call_from_tree): If LHS is a gimple reg, attach the original VDEF to the last store in the sequence. testsuite/ PR bootstrap/44699 * gcc.dg/pr44699.c: New test. From-SVN: r161614
Diffstat (limited to 'gcc/gimple-fold.c')
-rw-r--r--gcc/gimple-fold.c24
1 files changed, 19 insertions, 5 deletions
diff --git a/gcc/gimple-fold.c b/gcc/gimple-fold.c
index 491611f..a1fc020 100644
--- a/gcc/gimple-fold.c
+++ b/gcc/gimple-fold.c
@@ -1133,7 +1133,8 @@ gimplify_and_update_call_from_tree (gimple_stmt_iterator *si_p, tree expr)
if (gimple_vdef (stmt) && laststore)
{
gimple_set_vdef (laststore, gimple_vdef (stmt));
- move_ssa_defining_stmt_for_defs (laststore, stmt);
+ if (TREE_CODE (gimple_vdef (stmt)) == SSA_NAME)
+ SSA_NAME_DEF_STMT (gimple_vdef (stmt)) = laststore;
update_stmt (laststore);
}
else
@@ -1150,7 +1151,15 @@ gimplify_and_update_call_from_tree (gimple_stmt_iterator *si_p, tree expr)
gsi_insert_before (si_p, last, GSI_NEW_STMT);
gsi_next (si_p);
}
- if (laststore)
+ if (laststore && is_gimple_reg (lhs))
+ {
+ gimple_set_vdef (laststore, gimple_vdef (stmt));
+ update_stmt (laststore);
+ if (TREE_CODE (gimple_vdef (stmt)) == SSA_NAME)
+ SSA_NAME_DEF_STMT (gimple_vdef (stmt)) = laststore;
+ laststore = NULL;
+ }
+ else if (laststore)
{
reaching_vuse = make_ssa_name (gimple_vop (cfun), laststore);
gimple_set_vdef (laststore, reaching_vuse);
@@ -1158,9 +1167,14 @@ gimplify_and_update_call_from_tree (gimple_stmt_iterator *si_p, tree expr)
laststore = NULL;
}
new_stmt = gimple_build_assign (lhs, tmp);
- gimple_set_vuse (new_stmt, reaching_vuse);
- gimple_set_vdef (new_stmt, gimple_vdef (stmt));
- move_ssa_defining_stmt_for_defs (new_stmt, stmt);
+ if (!is_gimple_reg (tmp))
+ gimple_set_vuse (new_stmt, reaching_vuse);
+ if (!is_gimple_reg (lhs))
+ {
+ gimple_set_vdef (new_stmt, gimple_vdef (stmt));
+ if (TREE_CODE (gimple_vdef (stmt)) == SSA_NAME)
+ SSA_NAME_DEF_STMT (gimple_vdef (stmt)) = new_stmt;
+ }
}
gimple_set_location (new_stmt, gimple_location (stmt));