Fix clustering algorithm in switch expansion.
authorMartin Liska <mliska@suse.cz>
Thu, 28 Jun 2018 07:14:57 +0000 (09:14 +0200)
committerMartin Liska <marxin@gcc.gnu.org>
Thu, 28 Jun 2018 07:14:57 +0000 (07:14 +0000)
commitdf7c79742af79bc2873ca28a8b3037a088444ca7
treed5a6e4444e56568e59909022661c11a5e58bbaea
parentd86c7648fb9643640d8c82be19d49927aa488768
Fix clustering algorithm in switch expansion.

2018-06-28  Martin Liska  <mliska@suse.cz>

* tree-switch-conversion.c (jump_table_cluster::find_jump_tables):
        Add new checking assert to catch invalid state.
(jump_table_cluster::can_be_handled): Handle single case
        clusters.
(jump_table_cluster::is_beneficial): Bail out for such case.
(bit_test_cluster::find_bit_tests):
        Add new checking assert to catch invalid state.
(bit_test_cluster::can_be_handled): Handle single case
        clusters.
(bit_test_cluster::is_beneficial): Bail out for such case.
(switch_decision_tree::analyze_switch_statement):
        Fix comment.
2018-06-28  Martin Liska  <mliska@suse.cz>

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

From-SVN: r262211
gcc/ChangeLog
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/tree-ssa/switch-1.c [new file with mode: 0644]
gcc/tree-switch-conversion.c