https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69713
--- Comment #4 from Oleg Endo <olegendo at gcc dot gnu.org> --- (In reply to Oleg Endo from comment #3) > > One option could be to merge the casesi_0 and casesi_worker_0 / > casesi_worker_1 patterns somehow into one pattern, so that the block remains > in one place. > > Another option I can think of would be feeding the bounds check comparison > result from the casesi_0 insns into casesi_worker_0/casesi_worker_1 and add > a conditional branch around the table access. Option 3) Try adding a T_REG use in casesi_worker_0/casesi_worker_1 patterns to create a link between the bounds checking insn and the table access insns. Option 4) Try implementing the "tablejump" pattern instead of "casesi" and let the middle-end handle the bounds checking.