Import various range-op fixes from ranger branch.
authorAldy Hernandez <aldyh@redhat.com>
Mon, 5 Oct 2020 15:08:11 +0000 (17:08 +0200)
committerAldy Hernandez <aldyh@redhat.com>
Mon, 5 Oct 2020 17:48:55 +0000 (19:48 +0200)
commitbd431d26de02180d7fac1a794e2b9d3aaa4df34d
tree98227b77c21cfeccca6cdae466ffdf4897b56a65
parentac1c65ad1a16d83ec63674efa07c00b062562f15
Import various range-op fixes from ranger branch.

This patch imports three fixes from the ranger branch:

1. Fold division by zero into varying instead of undefined.
This provides compatibility with existing stuff on trunk.

2. Solver changes for lshift.
This should not affect anything on trunk, as it only involves
the GORI solver which is yet to be contributed.

3. Preserve existing behavior for ABS([-MIN,-MIN]).
This is actually unrepresentable, but trunk has traditionally
treated this as [-MIN,-MIN] so this patch just syncs range-ops
with the rest of trunk.

gcc/ChangeLog:

* range-op.cc (operator_div::wi_fold): Return varying for
division by zero.
(class operator_rshift): Move class up.
(operator_abs::wi_fold): Return [-MIN,-MIN] for ABS([-MIN,-MIN]).
(operator_tests): Adjust tests.
gcc/range-op.cc