In PR 23046 we ICE inside tree-vrp.c because fold() does not
realize that for
enum enumtype { ENUM1, ENUM2 } x;
the predicate 'if (x > 1)' is always false. This causes VRP to
create the impossible range [2, 1] for that predicate.
While it would be trivial for VRP to paper over this problem, the
real fix should be in fold(). I looked at the logic that detects
these cases and it is fairly convoluted (fold-const.c:9174).
I'm wondering why doesn't fold() just use TYPE_MAX_VALUE/TYPE_MIN_VALUE
if they're available?
Thanks.