From f831807967c55f828ba7dfb304f12f086d943417 Mon Sep 17 00:00:00 2001 From: Roger Sayle Date: Mon, 13 Mar 2006 23:47:47 +0000 Subject: re PR middle-end/26557 (ICE in simplify_subreg) PR middle-end/26557 * stmt.c (emit_case_nodes): Handle the case where the index is a CONST_INT, where the comparison mode is specified by the index type. * gcc.c-torture/compile/switch-1.c: New test case. From-SVN: r112032 --- gcc/stmt.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'gcc/stmt.c') diff --git a/gcc/stmt.c b/gcc/stmt.c index d199398..a3e3db3 100644 --- a/gcc/stmt.c +++ b/gcc/stmt.c @@ -2944,6 +2944,10 @@ emit_case_nodes (rtx index, case_node_ptr node, rtx default_label, enum machine_mode mode = GET_MODE (index); enum machine_mode imode = TYPE_MODE (index_type); + /* Handle indices detected as constant during RTL expansion. */ + if (mode == VOIDmode) + mode = imode; + /* See if our parents have already tested everything for us. If they have, emit an unconditional jump for this node. */ if (node_is_bounded (node, index_type)) -- cgit v1.1