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

--- Comment #21 from Martin Liška <marxin at gcc dot gnu.org> ---
> See my comment above.  It isn't any integration of VRP, just asking the
> ranger about the range, and it isn't useless because to be able to optimize
> properly,
> you need to figure out for each value one of the 3 possibilities (handled
> explicitly by switch and well defined, handled by default and never
> reachable or UB).

I've got the point that we have these 3 possibilities for each case.
However, we also have it for "holes" which are removed and we can't distinguish
them in between __builtin_unreachable and falling to the default case.

I believe a better place for Ranger is to improve:
simplify_using_ranges::simplify_switch_using_ranges (gswitch *stmt)

Note that even if CSWITCH does not do a transformation other passes can still
benefit from a more canonical gswitch form.

That said, I don't like the idea of using Ranger in cswitch because similar
should do each pass that somehow works with switches.

Reply via email to