------- Comment #4 from rguenth at gcc dot gnu dot org 2008-08-27 15:27 ------- The FE generates
if ((SAVE_EXPR <cd2a24e__ident ((integer) c1)> < c1 || SAVE_EXPR <cd2a24e__ident ((integer) c1)> > c2) || cd2a24e__ident (4) <= 3 && c2 > 2) { where c2 is of type cd2a24e__check_type (an enum with the range [3, 5]). As you can see the comparison is against a value of different type (actually it's of the same type, but it is out-of-range). VRP generates a fallback range using TYPE_MIN_VALUE producing [3, 2] which leads to the ICE. This out-of-range comparison is generated by fold from 3 <= c2 during canonicalization. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=37005