https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107767
--- Comment #11 from Jakub Jelinek <jakub at gcc dot gnu.org> --- (In reply to Martin Liška from comment #7) > However, the CFG is not collapsed and thus it fails due to: > > bool > bit_test_cluster::is_beneficial (unsigned count, unsigned uniq) > { > return (((uniq == 1 && count >= 3) > || (uniq == 2 && count >= 5) > || (uniq == 3 && count >= 6))); > } > > as count == 7. and so tree-switch-conversion happens. So one can mitigate > that with: > 1) use switch statement instead of if series > 2) reduce -param=switch-conversion-max-branch-ratio= that will not create so > big CSWTCH array > 3) disable tree-switch-conversion pass But that just means that either iftoswitch should happen earlier or switchconv later so that some other pass would remove the redundancies, or iftoswitch should perform them when it optimizes something, or switchconv should not rely on the collapsing being done already and do it itself. In the #c9 testcase, it is cleanup_tree_cfg (TODO_update_ssa) during ccp1 pass that optimizes it. But cleanup_tree_cfg (0) during iftoswitch for firewall2 doesn't do that for some reason.