Learn CFG cleanup to transform single case switches to gcond.
authorMartin Liska <mliska@suse.cz>
Tue, 5 Sep 2017 08:12:27 +0000 (10:12 +0200)
committerMartin Liska <marxin@gcc.gnu.org>
Tue, 5 Sep 2017 08:12:27 +0000 (08:12 +0000)
commit02e637d86f9ecb6d0e368438291bb6f6f8feb3ab
tree93af2d7dae66c7bb229217f75ae4b0d99853f7c7
parentb471c5c6cf2bfe51699b7fcbcffc34024ff7bfce
Learn CFG cleanup to transform single case switches to gcond.

2017-09-05  Martin Liska  <mliska@suse.cz>

PR tree-optimization/82032
* tree-cfg.c (generate_range_test): New function.
* tree-cfg.h (generate_range_test): Declared here.
* tree-cfgcleanup.c (convert_single_case_switch): New function.
(cleanup_control_expr_graph): Use it.
* tree-switch-conversion.c (try_switch_expansion): Remove
assert.
(emit_case_nodes): Use generate_range_test.
2017-09-05  Martin Liska  <mliska@suse.cz>

PR tree-optimization/82032
* g++.dg/other/pr82032.C: New test.
* gcc.dg/tree-ssa/pr68198.c: Update scanned pattern.
* gcc.dg/tree-ssa/vrp34.c: Likewise.
* gcc.dg/switch-10.c: Likewise.

From-SVN: r251690
gcc/ChangeLog
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/other/pr82032.C [new file with mode: 0644]
gcc/testsuite/gcc.dg/switch-10.c
gcc/testsuite/gcc.dg/tree-ssa/pr68198.c
gcc/testsuite/gcc.dg/tree-ssa/vrp34.c
gcc/tree-cfg.c
gcc/tree-cfg.h
gcc/tree-cfgcleanup.c
gcc/tree-switch-conversion.c