diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 34bc72166e40..3c80e770d247 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2016-03-24 Richard Biener + + PR tree-optimization/70372 + * tree-ssa-reassoc.c (eliminate_plus_minus_pair): Use + build_all_ones_cst to also handle vector types correctly. + 2016-03-23 Michael Meissner PR target/70381 diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 3a5cf65c2ab6..aa30b1e72824 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2016-03-24 Richard Biener + + PR tree-optimization/70372 + * gcc.dg/tree-ssa/pr70372.c: New testcase. + 2016-03-23 Patrick Palka PR c++/70347 diff --git a/gcc/testsuite/gcc.dg/tree-ssa/pr70372.c b/gcc/testsuite/gcc.dg/tree-ssa/pr70372.c new file mode 100644 index 000000000000..a6d18d25c1c7 --- /dev/null +++ b/gcc/testsuite/gcc.dg/tree-ssa/pr70372.c @@ -0,0 +1,14 @@ +/* { dg-do compile } */ +/* { dg-options "-O -fno-tree-fre -w -Wno-psabi" } */ + +typedef unsigned v2ti __attribute__ ((vector_size (32))); + +v2ti +foo (v2ti u, v2ti v) +{ + u[0] >>= 0xf; + v ^= ~v; + v &= ~u; + v -= -u; + return v; +} diff --git a/gcc/tree-ssa-reassoc.c b/gcc/tree-ssa-reassoc.c index 0340df249301..d23dabde7b6b 100644 --- a/gcc/tree-ssa-reassoc.c +++ b/gcc/tree-ssa-reassoc.c @@ -821,7 +821,7 @@ eliminate_plus_minus_pair (enum tree_code opcode, } ops->ordered_remove (i); - add_to_ops_vec (ops, build_int_cst_type (op_type, -1)); + add_to_ops_vec (ops, build_all_ones_cst (op_type)); ops->ordered_remove (currindex); reassociate_stats.ops_eliminated ++;