]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
re PR tree-optimization/60502 (ICE reassociation and vector types.)
authorJakub Jelinek <jakub@redhat.com>
Wed, 12 Mar 2014 09:21:59 +0000 (10:21 +0100)
committerJakub Jelinek <jakub@gcc.gnu.org>
Wed, 12 Mar 2014 09:21:59 +0000 (10:21 +0100)
PR tree-optimization/60502
* tree-ssa-reassoc.c (eliminate_not_pairs): Use build_all_ones_cst
instead of build_low_bits_mask.

* gcc.c-torture/compile/pr60502.c: New test.

Co-Authored-By: Marc Glisse <marc.glisse@inria.fr>
From-SVN: r208507

gcc/ChangeLog
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.c-torture/compile/pr60502.c [new file with mode: 0644]
gcc/tree-ssa-reassoc.c

index c2bc1e3a1b5cd5c4ef3dfaa2a24fd1f098a47eab..446f51966f5d7b3fa49c996d225dfe3c9367f02b 100644 (file)
@@ -1,3 +1,10 @@
+2014-03-12  Jakub Jelinek  <jakub@redhat.com>
+           Marc Glisse  <marc.glisse@inria.fr>
+
+       PR tree-optimization/60502
+       * tree-ssa-reassoc.c (eliminate_not_pairs): Use build_all_ones_cst
+       instead of build_low_bits_mask.
+
 2014-03-12  Jakub Jelinek  <jakub@redhat.com>
 
        PR middle-end/60482
index fe99d64cdd1b0fa5b2f4da91610332ef025355ab..24d0d9ad81cbd965d2293bef0873aec04a2cc044 100644 (file)
@@ -1,3 +1,9 @@
+2014-03-12  Jakub Jelinek  <jakub@redhat.com>
+           Marc Glisse  <marc.glisse@inria.fr>
+
+       PR tree-optimization/60502
+       * gcc.c-torture/compile/pr60502.c: New test.
+
 2014-03-12  Jakub Jelinek  <jakub@redhat.com>
 
        PR middle-end/60482
diff --git a/gcc/testsuite/gcc.c-torture/compile/pr60502.c b/gcc/testsuite/gcc.c-torture/compile/pr60502.c
new file mode 100644 (file)
index 0000000..8dd2de4
--- /dev/null
@@ -0,0 +1,18 @@
+/* PR tree-optimization/60502 */
+
+typedef signed char v16i8 __attribute__ ((vector_size (16)));
+typedef unsigned char v16u8 __attribute__ ((vector_size (16)));
+
+void
+foo (v16i8 *x)
+{
+  v16i8 m1 = { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 };
+  *x |= *x ^ m1;
+}
+
+void
+bar (v16u8 *x)
+{
+  v16u8 m1 = { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 };
+  *x |= *x ^ m1;
+}
index df8cca84a30761cc5a949e383849fca192172888..99282227039846ab14f84a1f75d33380d8b2bf6d 100644 (file)
@@ -806,8 +806,7 @@ eliminate_not_pairs (enum tree_code opcode,
          if (opcode == BIT_AND_EXPR)
            oe->op = build_zero_cst (TREE_TYPE (oe->op));
          else if (opcode == BIT_IOR_EXPR)
-           oe->op = build_low_bits_mask (TREE_TYPE (oe->op),
-                                         TYPE_PRECISION (TREE_TYPE (oe->op)));
+           oe->op = build_all_ones_cst (TREE_TYPE (oe->op));
 
          reassociate_stats.ops_eliminated += ops->length () - 1;
          ops->truncate (0);