From c888139c9aee51699484bf7e442b208a962773c8 Mon Sep 17 00:00:00 2001 From: Jakub Jelinek Date: Wed, 12 Mar 2014 10:21:59 +0100 Subject: [PATCH] re PR tree-optimization/60502 (ICE reassociation and vector types.) 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 From-SVN: r208507 --- gcc/ChangeLog | 7 +++++++ gcc/testsuite/ChangeLog | 6 ++++++ gcc/testsuite/gcc.c-torture/compile/pr60502.c | 18 ++++++++++++++++++ gcc/tree-ssa-reassoc.c | 3 +-- 4 files changed, 32 insertions(+), 2 deletions(-) create mode 100644 gcc/testsuite/gcc.c-torture/compile/pr60502.c diff --git a/gcc/ChangeLog b/gcc/ChangeLog index c2bc1e3a1b5c..446f51966f5d 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,10 @@ +2014-03-12 Jakub Jelinek + Marc Glisse + + 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 PR middle-end/60482 diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index fe99d64cdd1b..24d0d9ad81cb 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,9 @@ +2014-03-12 Jakub Jelinek + Marc Glisse + + PR tree-optimization/60502 + * gcc.c-torture/compile/pr60502.c: New test. + 2014-03-12 Jakub Jelinek 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 index 000000000000..8dd2de44dae2 --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/compile/pr60502.c @@ -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; +} diff --git a/gcc/tree-ssa-reassoc.c b/gcc/tree-ssa-reassoc.c index df8cca84a307..992822270398 100644 --- a/gcc/tree-ssa-reassoc.c +++ b/gcc/tree-ssa-reassoc.c @@ -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); -- 2.43.5