OSDN Git Service

2009-07-20 Shujing Zhao <pearly.zhao@oracle.com>
[pf3gnuchains/gcc-fork.git] / gcc / tree-ssa-sccvn.c
index 03fea75..8557b0b 100644 (file)
@@ -1362,7 +1362,7 @@ vn_reference_insert_pieces (tree vuse, alias_set_type set, tree type,
 
 /* Compute and return the hash value for nary operation VBO1.  */
 
-inline hashval_t
+hashval_t
 vn_nary_op_compute_hash (const vn_nary_op_t vno1)
 {
   hashval_t hash = 0;
@@ -1976,6 +1976,12 @@ visit_reference_op_load (tree lhs, tree op, gimple stmt)
   bool changed = false;
   tree result = vn_reference_lookup (op, gimple_vuse (stmt), true, NULL);
 
+  /* If we have a VCE, try looking up its operand as it might be stored in
+     a different type.  */
+  if (!result && TREE_CODE (op) == VIEW_CONVERT_EXPR)
+    result = vn_reference_lookup (TREE_OPERAND (op, 0), gimple_vuse (stmt),
+                                 true, NULL);
+
   /* We handle type-punning through unions by value-numbering based
      on offset and size of the access.  Be prepared to handle a
      type-mismatch here via creating a VIEW_CONVERT_EXPR.  */