re PR tree-optimization/32571 (ICE in set_ssa_val_to, at tree-ssa-sccvn.c:1011)
authorDaniel Berlin <dberlin@dberlin.org>
Mon, 2 Jul 2007 04:35:37 +0000 (04:35 +0000)
committerDaniel Berlin <dberlin@gcc.gnu.org>
Mon, 2 Jul 2007 04:35:37 +0000 (04:35 +0000)
2007-07-01  Daniel Berlin  <dberlin@dberlin.org>

Fix PR tree-optimization/32571
* tree-ssa-sccvn.c (visit_use): Shortcut copies to avoid
simplifying them.

From-SVN: r126186

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

index a5a83eed8ac4ae8d3ba8c48c563b5f60502d9d9e..8c642d7c8791a5fe9174e87ee91b40cd876f5298 100644 (file)
@@ -1,3 +1,9 @@
+2007-07-01  Daniel Berlin  <dberlin@dberlin.org>
+
+       Fix PR tree-optimization/32571
+       * tree-ssa-sccvn.c (visit_use): Shortcut copies to avoid
+       simplifying them.
+
 2007-07-01  Daniel Berlin  <dberlin@dberlin.org>
 
        * tree-ssa-sccvn.c (copy_reference_ops_from_ref): Handle constants
index 45ebe08dfc7260a2959da50bc9f615aeeaab597c..b0db122368da9e336d4282a303f41ff2f58705be 100644 (file)
@@ -1545,6 +1545,13 @@ visit_use (tree use)
 
          STRIP_USELESS_TYPE_CONVERSION (rhs);
 
+         /* Shortcut for copies. Simplifying copies is pointless,
+            since we copy the expression and value they represent.  */
+         if (TREE_CODE (rhs) == SSA_NAME && TREE_CODE (lhs) == SSA_NAME)
+           {
+             changed = visit_copy (lhs, rhs);
+             goto done;
+           }
          simplified = try_to_simplify (stmt, rhs);
          if (simplified && simplified != rhs)
            {
@@ -1623,8 +1630,6 @@ visit_use (tree use)
                  VN_INFO (lhs)->expr = rhs;
                  changed = set_ssa_val_to (lhs, rhs);
                }
-             else if (TREE_CODE (rhs) == SSA_NAME)
-               changed = visit_copy (lhs, rhs);
              else
                {
                  switch (TREE_CODE_CLASS (TREE_CODE (rhs)))