re PR tree-optimization/81588 (Wrong code at -O2)
authorJakub Jelinek <jakub@redhat.com>
Tue, 1 Aug 2017 08:32:37 +0000 (10:32 +0200)
committerJakub Jelinek <jakub@gcc.gnu.org>
Tue, 1 Aug 2017 08:32:37 +0000 (10:32 +0200)
commitda98e3b126ee9976c24a1e64b99219b3444b4873
tree96a9392946ef93061a405cb399b0b97f0c17b674
parentff03930a11f3a996e512ed3613eedc1b50ac5b30
re PR tree-optimization/81588 (Wrong code at -O2)

PR tree-optimization/81588
* tree-ssa-reassoc.c (optimize_range_tests_var_bound): If
ranges[i].in_p, invert comparison code ccode.  For >/>=,
swap rhs1 and rhs2 and comparison code unconditionally,
for </<= don't do that.  Don't swap rhs1/rhs2 again if
ranges[i].in_p, instead invert comparison code ccode if
opcode or oe->rank is BIT_IOR_EXPR.

* gcc.dg/tree-ssa/pr81588.c: New test.
* gcc.dg/pr81588.c: New test.
* gcc.c-torture/execute/pr81588.c: New test.

From-SVN: r250760
gcc/ChangeLog
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.c-torture/execute/pr81588.c [new file with mode: 0644]
gcc/testsuite/gcc.dg/pr81588.c [new file with mode: 0644]
gcc/testsuite/gcc.dg/tree-ssa/pr81588.c [new file with mode: 0644]
gcc/tree-ssa-reassoc.c