From 0dc262e0511dead7ab7f657d9de83a0bc80eb47f Mon Sep 17 00:00:00 2001 From: rguenth Date: Mon, 20 Aug 2012 12:04:38 +0000 Subject: 2012-08-20 Richard Guenther * tree-flow.h (register_new_name_mapping): Remove. * tree-into-ssa.c (register_new_name_mapping): Likewise. (add_new_name_mapping): Do not push/pop timevar here. (create_new_def_for): Instead do it here. Initialize update-ssa here, handle a NULL def. * tree-vrp.c (build_assert_expr_for): Use create_new_def_for. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@190531 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/tree-vrp.c | 31 +++++++++---------------------- 1 file changed, 9 insertions(+), 22 deletions(-) (limited to 'gcc/tree-vrp.c') diff --git a/gcc/tree-vrp.c b/gcc/tree-vrp.c index 0fd400d97cc..f0d68ebf8eb 100644 --- a/gcc/tree-vrp.c +++ b/gcc/tree-vrp.c @@ -4152,33 +4152,20 @@ debug_all_value_ranges (void) static gimple build_assert_expr_for (tree cond, tree v) { - tree n; + tree a; gimple assertion; - gcc_assert (TREE_CODE (v) == SSA_NAME); - n = duplicate_ssa_name (v, NULL); + gcc_assert (TREE_CODE (v) == SSA_NAME + && COMPARISON_CLASS_P (cond)); - if (COMPARISON_CLASS_P (cond)) - { - tree a = build2 (ASSERT_EXPR, TREE_TYPE (v), v, cond); - assertion = gimple_build_assign (n, a); - } - else if (TREE_CODE (cond) == SSA_NAME) - { - /* Given V, build the assignment N = true. */ - gcc_assert (v == cond); - assertion = gimple_build_assign (n, boolean_true_node); - } - else - gcc_unreachable (); - - SSA_NAME_DEF_STMT (n) = assertion; + a = build2 (ASSERT_EXPR, TREE_TYPE (v), v, cond); + assertion = gimple_build_assign (NULL_TREE, a); /* The new ASSERT_EXPR, creates a new SSA name that replaces the - operand of the ASSERT_EXPR. Register the new name and the old one - in the replacement table so that we can fix the SSA web after - adding all the ASSERT_EXPRs. */ - register_new_name_mapping (n, v); + operand of the ASSERT_EXPR. Create it so the new name and the old one + are registered in the replacement table so that we can fix the SSA web + after adding all the ASSERT_EXPRs. */ + create_new_def_for (v, assertion, NULL); return assertion; } -- cgit v1.2.1