aboutsummaryrefslogtreecommitdiff
path: root/gcc/stmt.c
diff options
context:
space:
mode:
authorPeter Bergner <bergner@vnet.ibm.com>2017-06-29 07:58:32 -0500
committerPeter Bergner <bergner@gcc.gnu.org>2017-06-29 07:58:32 -0500
commitf66459c1605ab66390ad5b5c54e425f96607d9eb (patch)
treefc3f329844a8125ad6b273d8b28aeb02e1aa8f15 /gcc/stmt.c
parent3c7bb4891238d341dcd1404cf45b041fc1af0720 (diff)
downloadgcc-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.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/gcc/stmt.c b/gcc/stmt.c
index 9b5157d..fdf29a5 100644
--- a/gcc/stmt.c
+++ b/gcc/stmt.c
@@ -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 ();