re PR tree-optimization/85529 (wrong code at -O2 and -O3 on x86_64-linux-gnu)
authorJakub Jelinek <jakub@redhat.com>
Fri, 27 Apr 2018 07:09:51 +0000 (09:09 +0200)
committerJakub Jelinek <jakub@gcc.gnu.org>
Fri, 27 Apr 2018 07:09:51 +0000 (09:09 +0200)
commit92007ba60738fabe2e3fb87796bcebe344062fbc
tree74e2ce4905d4bbeed0e07c8c2392f9066d7a1b5e
parentbe876cc498129017fcb0d7cf93620da6e5ea832a
re PR tree-optimization/85529 (wrong code at -O2 and -O3 on x86_64-linux-gnu)

PR tree-optimization/85529
* tree-ssa-reassoc.c (optimize_range_tests_var_bound): Add FIRST_BB
argument.  Don't call get_nonzero_bits if opcode is ERROR_MARK_NODE,
rhs2 def stmt's bb is dominated by first_bb and it isn't an obvious
zero extension or masking of the MSB bit.
(optimize_range_tests): Add FIRST_BB argument, pass it through
to optimize_range_tests_var_bound.
(maybe_optimize_range_tests, reassociate_bb): Adjust
optimize_range_tests callers.

* gcc.c-torture/execute/pr85529-1.c: New test.
* gcc.c-torture/execute/pr85529-2.c: New test.
* gcc.dg/pr85529.c: New test.

From-SVN: r259696
gcc/ChangeLog
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.c-torture/execute/pr85529-1.c [new file with mode: 0644]
gcc/testsuite/gcc.c-torture/execute/pr85529-2.c [new file with mode: 0644]
gcc/testsuite/gcc.dg/pr85529.c [new file with mode: 0644]
gcc/tree-ssa-reassoc.c