diff options
author | Peter Bergner <bergner@vnet.ibm.com> | 2017-06-29 07:58:32 -0500 |
---|---|---|
committer | Peter Bergner <bergner@gcc.gnu.org> | 2017-06-29 07:58:32 -0500 |
commit | f66459c1605ab66390ad5b5c54e425f96607d9eb (patch) | |
tree | fc3f329844a8125ad6b273d8b28aeb02e1aa8f15 /gcc/stmt.c | |
parent | 3c7bb4891238d341dcd1404cf45b041fc1af0720 (diff) | |
download | gcc-f66459c1605ab66390ad5b5c54e425f96607d9eb.zip gcc-f66459c1605ab66390ad5b5c54e425f96607d9eb.tar.gz gcc-f66459c1605ab66390ad5b5c54e425f96607d9eb.tar.bz2 |
re PR middle-end/81194 (ICE during RTL pass: expand)
gcc/
PR middle-end/81194
* cfgexpand.c (expand_gimple_stmt_1): Handle switch statements
with only one label.
* stmt.c (expand_case): Assert NCASES is greater than one.
gcc/testsuite/
PR middle-end/81194
* g++.dg/pr81194.C: New test.
From-SVN: r249783
Diffstat (limited to 'gcc/stmt.c')
-rw-r--r-- | gcc/stmt.c | 5 |
1 files changed, 4 insertions, 1 deletions
@@ -1142,7 +1142,10 @@ expand_case (gswitch *stmt) /* cleanup_tree_cfg removes all SWITCH_EXPR with their index expressions being INTEGER_CST. */ gcc_assert (TREE_CODE (index_expr) != INTEGER_CST); - + + /* Optimization of switch statements with only one label has already + occurred, so we should never see them at this point. */ + gcc_assert (ncases > 1); do_pending_stack_adjust (); |