https://gcc.gnu.org/bugzilla/show_bug.cgi?id=117100
--- Comment #8 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
(In reply to Andrew Pinski from comment #7)
> (In reply to Sam James from comment #6)
> > Simplified a bit:
>
> Just some debug:
>
> When we create one of the unswitch_predicate for the second switch, we have:
>
> true_range:
> [irange] int [4, 4][6, 6][8, 8] NONZERO 0xf
> false_range:
> [irange] int [4, +INF] NONZERO 0x7fffffff
>
> That false_range looks wrong because there is no .
>
> It was created by doing:
> false_range = true_range;
> if (!false_range.varying_p ()
> && !false_range.undefined_p ())
> false_range.invert ();
>
> The code looks correct.
I did a quick hack:
static int t = 0;
t++;
if (t == 4)
false_range.set_undefined();
Since this was the 4th creation of unswitch_predicate and that worked.