https://gcc.gnu.org/bugzilla/show_bug.cgi?id=120080
--- Comment #10 from Filip Kastl <pheeck at gcc dot gnu.org> --- The line that crashes GCC seems to be this one gcc_checking_assert (l > 0); where l is the number of clusters of a switch. At this point in compilation clusters = cases so this means that bit-test switch lowering ran into a switch without cases. This should work as a trivial fix: Replace the crashing line with if (l == 0) return clusters.copy(); I'll bootstrap and regtest this fix and then I'll push it. I thought that switch lowering shouldn't run into empty switches (can't recall what made me think that though). I'll look into why that happens.