diff options
author | rguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4> | 2012-08-20 12:04:38 +0000 |
---|---|---|
committer | rguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4> | 2012-08-20 12:04:38 +0000 |
commit | 0dc262e0511dead7ab7f657d9de83a0bc80eb47f (patch) | |
tree | 4243d9b223592f03b424450def658d3b50bbddd8 /gcc/tree-vrp.c | |
parent | c91260ab962c4cc93e09d08ebcbe9ee0ab36e161 (diff) | |
download | gcc-0dc262e0511dead7ab7f657d9de83a0bc80eb47f.tar.gz |
2012-08-20 Richard Guenther <rguenther@suse.de>
* 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
Diffstat (limited to 'gcc/tree-vrp.c')
-rw-r--r-- | gcc/tree-vrp.c | 31 |
1 files changed, 9 insertions, 22 deletions
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; } |