re PR tree-optimization/91351 (-fstrict-enums generates incorrect code)
authorJakub Jelinek <jakub@redhat.com>
Thu, 29 Aug 2019 09:20:54 +0000 (11:20 +0200)
committerJakub Jelinek <jakub@gcc.gnu.org>
Thu, 29 Aug 2019 09:20:54 +0000 (11:20 +0200)
commit1d9cd701ec31686dbd037e0fe264c8738d993e41
treec21d3fa2978d3c7b2e588a5c894f40a108b0f09d
parentc3bad34748071038343f8b88a30128faee7c5c0c
re PR tree-optimization/91351 (-fstrict-enums generates incorrect code)

PR tree-optimization/91351
* tree-cfg.c (generate_range_test): Use range_check_type instead of
unsigned_type_for.
* tree-cfgcleanup.c (convert_single_case_switch): Punt if
range_check_type returns NULL.
* tree-switch-conversion.c (switch_conversion::build_one_array):
Use range_check_type instead of unsigned_type_for, don't perform
linear opt if it returns NULL.
(bit_test_cluster::find_bit_tests): Formatting fix.
(bit_test_cluster::emit): Use range_check_type instead of
unsigned_type_for.
(switch_decision_tree::try_switch_expansion): Punt if range_check_type
returns NULL.

* g++.dg/opt/pr91351.C: New test.

From-SVN: r275026
gcc/ChangeLog
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/opt/pr91351.C [new file with mode: 0644]
gcc/tree-cfg.c
gcc/tree-cfgcleanup.c
gcc/tree-switch-conversion.c