diff options
author | Kugan Vivekanandarajah <kuganv@linaro.org> | 2016-06-06 23:46:11 +0000 |
---|---|---|
committer | Kugan Vivekanandarajah <kugan@gcc.gnu.org> | 2016-06-06 23:46:11 +0000 |
commit | ec963f2ae5a167060de578b72413ed4d870fe091 (patch) | |
tree | fb896e6b17b2b1900b966f416a4390a5dde1521f /gcc/tree-ssa-reassoc.c | |
parent | 46ab5b6edea83d9eb67a83572171493a8e2283b5 (diff) | |
download | gcc-ec963f2ae5a167060de578b72413ed4d870fe091.zip gcc-ec963f2ae5a167060de578b72413ed4d870fe091.tar.gz gcc-ec963f2ae5a167060de578b72413ed4d870fe091.tar.bz2 |
re PR tree-optimization/71408 (wrong code at -Os and above on x86_64-linux-gnu)
gcc/ChangeLog:
2016-06-07 Kugan Vivekanandarajah <kuganv@linaro.org>
PR middle-end/71408
* tree-ssa-reassoc.c (zero_one_operation): Fix NEGATE_EXPR operand for
propagate_op_to_single_use.
gcc/testsuite/ChangeLog:
2016-06-07 Kugan Vivekanandarajah <kuganv@linaro.org>
PR middle-end/71408
* gcc.dg/tree-ssa/pr71408.c: New test.
From-SVN: r237158
Diffstat (limited to 'gcc/tree-ssa-reassoc.c')
-rw-r--r-- | gcc/tree-ssa-reassoc.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/gcc/tree-ssa-reassoc.c b/gcc/tree-ssa-reassoc.c index 096b24d..36b34d3 100644 --- a/gcc/tree-ssa-reassoc.c +++ b/gcc/tree-ssa-reassoc.c @@ -1203,7 +1203,8 @@ zero_one_operation (tree *def, enum tree_code opcode, tree op) { if (gimple_assign_rhs1 (stmt) == op) { - propagate_op_to_single_use (op, stmt, def); + tree cst = build_minus_one_cst (TREE_TYPE (op)); + propagate_op_to_single_use (cst, stmt, def); return; } else if (integer_minus_onep (op) @@ -1251,7 +1252,8 @@ zero_one_operation (tree *def, enum tree_code opcode, tree op) { if (gimple_assign_rhs1 (stmt2) == op) { - propagate_op_to_single_use (op, stmt2, def); + tree cst = build_minus_one_cst (TREE_TYPE (op)); + propagate_op_to_single_use (cst, stmt2, def); return; } else if (integer_minus_onep (op) |