aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-vn.c
diff options
context:
space:
mode:
authorDaniel Berlin <dberlin@dberlin.org>2005-02-15 20:09:31 +0000
committerDaniel Berlin <dberlin@gcc.gnu.org>2005-02-15 20:09:31 +0000
commiteace8c18aa504923067581a1037a37b1cce97f9e (patch)
treebbcd7131bf7cbe8373d576e835080a501deb4951 /gcc/tree-vn.c
parente5e459bf3b9d5ff4a4cb3ae26268090ed180ae4e (diff)
downloadgcc-eace8c18aa504923067581a1037a37b1cce97f9e.zip
gcc-eace8c18aa504923067581a1037a37b1cce97f9e.tar.gz
gcc-eace8c18aa504923067581a1037a37b1cce97f9e.tar.bz2
tree-vn.c (get_value_handle): Make sure that given an is_gimple_min_invariant expression, we always return it.
2005-02-15 Daniel Berlin <dberlin@dberlin.org> * tree-vn.c (get_value_handle): Make sure that given an is_gimple_min_invariant expression, we always return it. From-SVN: r95072
Diffstat (limited to 'gcc/tree-vn.c')
-rw-r--r--gcc/tree-vn.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/gcc/tree-vn.c b/gcc/tree-vn.c
index ab952eb..22affff 100644
--- a/gcc/tree-vn.c
+++ b/gcc/tree-vn.c
@@ -267,11 +267,16 @@ vn_lookup_or_add (tree expr, vuse_optype vuses)
/* Get the value handle of EXPR. This is the only correct way to get
the value handle for a "thing". If EXPR does not have a value
- handle associated, it returns NULL_TREE. */
+ handle associated, it returns NULL_TREE.
+ NB: If EXPR is min_invariant, this function is *required* to return EXPR. */
tree
get_value_handle (tree expr)
{
+
+ if (is_gimple_min_invariant (expr))
+ return expr;
+
if (TREE_CODE (expr) == SSA_NAME)
return SSA_NAME_VALUE (expr);
else if (EXPR_P (expr) || DECL_P (expr))
@@ -280,10 +285,7 @@ get_value_handle (tree expr)
return ((ann) ? ann->common.value_handle : NULL_TREE);
}
else
- {
- gcc_assert (is_gimple_min_invariant (expr));
- return expr;
- }
+ gcc_unreachable ();
}