Do not ignore failures from gimple_range_calc_op2.
authorAndrew MacLeod <amacleod@redhat.com>
Mon, 12 Oct 2020 17:00:12 +0000 (13:00 -0400)
committerAldy Hernandez <aldyh@redhat.com>
Mon, 12 Oct 2020 18:05:56 +0000 (14:05 -0400)
commit46f4a397ab0907ce5786e1f0b92030a73e8b89ef
tree67ca3e250b413689dbfc0cba603144d07c030721
parentc5aad5a41838dbfd29ff114692ff9533b52746b4
Do not ignore failures from gimple_range_calc_op2.

We were ignoring the return value if op2 returned false and getting garbage ranges propagated.

gcc/ChangeLog:

PR tree-optimization/97381
* gimple-range-gori.cc (gori_compute::compute_operand2_range): If a range cannot be
calculated through operand 2, return false.

gcc/testsuite/ChangeLog:

* gcc.dg/pr97381.c: New test.
gcc/gimple-range-gori.cc
gcc/testsuite/gcc.dg/pr97381.c [new file with mode: 0644]