tree-ssa-sccvn.c (copy_reference_ops_from_ref): Handle constants and ohter expected...
authorDaniel Berlin <dberlin@dberlin.org>
Sun, 1 Jul 2007 23:41:38 +0000 (23:41 +0000)
committerDaniel Berlin <dberlin@gcc.gnu.org>
Sun, 1 Jul 2007 23:41:38 +0000 (23:41 +0000)
2007-07-01  Daniel Berlin  <dberlin@dberlin.org>

* tree-ssa-sccvn.c (copy_reference_ops_from_ref): Handle constants
and ohter expected operations explicitly, change default to
gcc_unreachable.

From-SVN: r126179

gcc/ChangeLog
gcc/tree-ssa-sccvn.c

index 295dc728021ddd686622515e1621e22a37b76a12..a5a83eed8ac4ae8d3ba8c48c563b5f60502d9d9e 100644 (file)
@@ -1,3 +1,9 @@
+2007-07-01  Daniel Berlin  <dberlin@dberlin.org>
+
+       * tree-ssa-sccvn.c (copy_reference_ops_from_ref): Handle constants
+       and other expected operations explicitly, change default to
+       gcc_unreachable. 
+
 2007-07-01  Daniel Jacobowitz  <dan@codesourcery.com>
 
        * config/arm/arm.c (arm_cannot_copy_insn_p): Do not expect a
index 89e399508e9bb349477606564f99241cdc654c4d..45ebe08dfc7260a2959da50bc9f615aeeaab597c 100644 (file)
@@ -524,6 +524,10 @@ copy_reference_ops_from_ref (tree ref, VEC(vn_reference_op_s, heap) **result)
          temp.op0 = TREE_OPERAND (ref, 1);
          temp.op1 = TREE_OPERAND (ref, 3);
          break;
+       case STRING_CST:
+       case INTEGER_CST:
+       case COMPLEX_CST:
+       case VECTOR_CST:
        case VALUE_HANDLE:
        case VAR_DECL:
        case PARM_DECL:
@@ -532,12 +536,23 @@ copy_reference_ops_from_ref (tree ref, VEC(vn_reference_op_s, heap) **result)
        case SSA_NAME:
          temp.op0 = ref;
          break;
-       default:
+         /* These are only interesting for their operands, their
+            existence, and their type.  They will never be the last
+            ref in the chain of references (IE they require an
+            operand), so we don't have to put anything
+            for op* as it will be handled by the iteration  */
+       case IMAGPART_EXPR:
+       case REALPART_EXPR:
+       case VIEW_CONVERT_EXPR:
+       case ADDR_EXPR:
          break;
+       default:
+         gcc_unreachable ();
+         
        }
       VEC_safe_push (vn_reference_op_s, heap, *result, &temp);
 
-      if (REFERENCE_CLASS_P (ref))
+      if (REFERENCE_CLASS_P (ref) || TREE_CODE (ref) == ADDR_EXPR)
        ref = TREE_OPERAND (ref, 0);
       else
        ref = NULL_TREE;