Prefer bit-test over the jump table.
authorMartin Liska <mliska@suse.cz>
Mon, 9 Nov 2020 13:26:04 +0000 (14:26 +0100)
committerMartin Liska <mliska@suse.cz>
Mon, 16 Nov 2020 09:54:29 +0000 (10:54 +0100)
commit5e303cdee1ff01e4b302ef2f913c0bdd84ab967e
tree3ecf62b09717cbf9318e2a62da0d74ca85cca855
parentd12603b746986554981f5ee220926a36a6cb6baf
Prefer bit-test over the jump table.

gcc/ChangeLog:

PR tree-optimization/97736
* tree-switch-conversion.c (switch_decision_tree::analyze_switch_statement):
Prefer bit tests.

gcc/testsuite/ChangeLog:

PR tree-optimization/97736
* gcc.dg/tree-ssa/switch-1.c: Prefer bit tests.
* g++.dg/tree-ssa/pr97736.C: New test.
gcc/testsuite/g++.dg/tree-ssa/pr97736.C [new file with mode: 0644]
gcc/testsuite/gcc.dg/tree-ssa/switch-1.c
gcc/tree-switch-conversion.c