Handle right shifts by zero in range-ops.
authorAldy Hernandez <aldyh@redhat.com>
Mon, 19 Oct 2020 07:48:27 +0000 (09:48 +0200)
committerAldy Hernandez <aldyh@redhat.com>
Mon, 19 Oct 2020 09:37:15 +0000 (11:37 +0200)
commit5b80069c7e65a3ed60ee16deac4a450a9c32efa6
tree5fb15f141f9210cc3000530128906284d1eccf2f
parent95f27849a580ac834d4f51a0642da9671f0a9dee
Handle right shifts by zero in range-ops.

If the shift amount in operator_lshift::op1_range was zero, an invalid range
of [1, 0] was being created.

gcc/ChangeLog:

PR tree-optimization/97467
* range-op.cc (operator_lshift::op1_range): Handle shifts by 0.

gcc/testsuite/ChangeLog:

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