]> git.ipfire.org Git - thirdparty/gcc.git/commit
gimple: Don't assert that switch has nondefault cases during lowering [PR120080]
authorFilip Kastl <fkastl@suse.cz>
Sat, 10 May 2025 14:18:33 +0000 (16:18 +0200)
committerFilip Kastl <fkastl@suse.cz>
Sat, 10 May 2025 14:18:33 +0000 (16:18 +0200)
commit358a5aedf2b5b61f4edfc7964144355a4897dbb9
tree35f50b03976e79465eeda365986f0cd5962ee671
parent36daa0da95fba18d0d4eb4e10fa07ac3b76fa426
gimple: Don't assert that switch has nondefault cases during lowering [PR120080]

I have mistakenly assumed that switch lowering cannot encounter a switch
with zero clusters.  This patch removes the relevant assert and instead
gives up bit-test lowering when this happens.

PR tree-optimization/120080

gcc/ChangeLog:

* tree-switch-conversion.cc (bit_test_cluster::find_bit_tests):
Replace assert with return.

gcc/testsuite/ChangeLog:

* gcc.dg/tree-ssa/pr120080.c: New test.

Signed-off-by: Filip Kastl <fkastl@suse.cz>
gcc/testsuite/gcc.dg/tree-ssa/pr120080.c [new file with mode: 0644]
gcc/tree-switch-conversion.cc