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

--- Comment #3 from Filip Kastl <pheeck at gcc dot gnu.org> ---
I just revisited this problem and thought of another solution: We could just
tell (early) vrp to not throw out the default case when it finds that it never
gets executed. Instead, vrp could just make sure the default case points to
__builtin_unreachable.

I think this would be a better solution. Leaving the default case but marking
it as unreachable conveys more information to the passes runing after vrp about
the switch statement.

I'll post an RFC about this.

Reply via email to