This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

PR 23046. Folding predicates involving TYPE_MAX_VALUE/TYPE_MIN_VALUE


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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]