]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
re PR tree-optimization/54825 (ICE with vector extension)
authorRichard Guenther <rguenther@suse.de>
Mon, 8 Oct 2012 11:58:03 +0000 (11:58 +0000)
committerRichard Biener <rguenth@gcc.gnu.org>
Mon, 8 Oct 2012 11:58:03 +0000 (11:58 +0000)
2012-10-08  Richard Guenther  <rguenther@suse.de>

PR tree-optimization/54825
* tree-ssa-sccvn.c (vn_nary_length_from_stmt): Handle BIT_FIELD_REF.
(init_vn_nary_op_from_stmt): Likewise.
* tree-ssa-pre.c (compute_avail): Use vn_nary_op_lookup_stmt.
* tree-ssa-sccvn.h (sizeof_vn_nary_op): Avoid overflow.

From-SVN: r192205

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

index f1e815e3f0b4649063e2529830fba96e90349b4c..b9eb340befdf7c1b4a971e74d4363d64467a5397 100644 (file)
@@ -1,3 +1,11 @@
+2012-10-08  Richard Guenther  <rguenther@suse.de>
+
+       PR tree-optimization/54825
+       * tree-ssa-sccvn.c (vn_nary_length_from_stmt): Handle BIT_FIELD_REF.
+       (init_vn_nary_op_from_stmt): Likewise.
+       * tree-ssa-pre.c (compute_avail): Use vn_nary_op_lookup_stmt.
+       * tree-ssa-sccvn.h (sizeof_vn_nary_op): Avoid overflow.
+
 2012-10-08  Richard Guenther  <rguenther@suse.de>
 
        * tree-ssa-pre.c (postorder_num): New global.
index 5feed3b5153178929ab51390504b21b4587c671c..fe9186cefa94bcdc80ff220923eed1d90a8768c9 100644 (file)
@@ -3849,11 +3849,7 @@ compute_avail (void)
                          || code == VEC_COND_EXPR)
                        continue;
 
-                     vn_nary_op_lookup_pieces (gimple_num_ops (stmt) - 1,
-                                               code,
-                                               gimple_expr_type (stmt),
-                                               gimple_assign_rhs1_ptr (stmt),
-                                               &nary);
+                     vn_nary_op_lookup_stmt (stmt, &nary);
                      if (!nary)
                        continue;
 
index 832328d328a26d782d89be0668147f23d32da7a4..2391632364d9951cbe2c93096b1b93a22f3e195f 100644 (file)
@@ -2194,6 +2194,9 @@ vn_nary_length_from_stmt (gimple stmt)
     case VIEW_CONVERT_EXPR:
       return 1;
 
+    case BIT_FIELD_REF:
+      return 3;
+
     case CONSTRUCTOR:
       return CONSTRUCTOR_NELTS (gimple_assign_rhs1 (stmt));
 
@@ -2220,6 +2223,13 @@ init_vn_nary_op_from_stmt (vn_nary_op_t vno, gimple stmt)
       vno->op[0] = TREE_OPERAND (gimple_assign_rhs1 (stmt), 0);
       break;
 
+    case BIT_FIELD_REF:
+      vno->length = 3;
+      vno->op[0] = TREE_OPERAND (gimple_assign_rhs1 (stmt), 0);
+      vno->op[1] = TREE_OPERAND (gimple_assign_rhs1 (stmt), 1);
+      vno->op[2] = TREE_OPERAND (gimple_assign_rhs1 (stmt), 2);
+      break;
+
     case CONSTRUCTOR:
       vno->length = CONSTRUCTOR_NELTS (gimple_assign_rhs1 (stmt));
       for (i = 0; i < vno->length; ++i)
@@ -2227,6 +2237,7 @@ init_vn_nary_op_from_stmt (vn_nary_op_t vno, gimple stmt)
       break;
 
     default:
+      gcc_checking_assert (!gimple_assign_single_p (stmt));
       vno->length = gimple_num_ops (stmt) - 1;
       for (i = 0; i < vno->length; ++i)
        vno->op[i] = gimple_op (stmt, i + 1);
index 956bde22da11cf496405b3cf03dcdcc3eed4b885..cd418da8704242207879057cc5002a5aaedca89a 100644 (file)
@@ -51,7 +51,7 @@ typedef const struct vn_nary_op_s *const_vn_nary_op_t;
 static inline size_t
 sizeof_vn_nary_op (unsigned int length)
 {
-  return sizeof (struct vn_nary_op_s) + sizeof (tree) * (length - 1);
+  return sizeof (struct vn_nary_op_s) + sizeof (tree) * length - sizeof (tree);
 }
 
 /* Phi nodes in the hashtable consist of their non-VN_TOP phi