https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94779

--- Comment #15 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
(In reply to Martin Liška from comment #14)
> Ok, I've just taken look at what EVRP pass does before SWITCHCONV pass is
> called.
> I see that EVRP can properly prune dead cases of a switch, but it's not
> perfect:
> 
> int f1(unsigned x)
> {
>     if (x == 2 || x == 3 || x >= 5)
>       __builtin_unreachable ();
>     switch (x)
>     {
>       case 0: return 1;
>       case 1: return 2;
>       case 2: return 3;
>       case 3 ... 8: return 4;
>     }
> }

The old VRP/EVRP only tracks simple ranges and anti-ranges, so can't deal with
what you have above, the new ranger code can deal with multiple subranges, but
the question is if all the interfaces deal with those.

> This seems to me like a strange EVRP transformation :/

Why?  And, the user could have written it that way too.

Reply via email to