aboutsummaryrefslogtreecommitdiff
path: root/gcc/stmt.c
diff options
context:
space:
mode:
authorRoger Sayle <sayle@gcc.gnu.org>2006-03-13 23:47:47 +0000
committerRoger Sayle <sayle@gcc.gnu.org>2006-03-13 23:47:47 +0000
commitf831807967c55f828ba7dfb304f12f086d943417 (patch)
treec4689c459a59af36095a53e46897d7983e27ada0 /gcc/stmt.c
parent26a851b930f908e3dffa57a3dfa2597c6ed004d7 (diff)
downloadgcc-f831807967c55f828ba7dfb304f12f086d943417.zip
gcc-f831807967c55f828ba7dfb304f12f086d943417.tar.gz
gcc-f831807967c55f828ba7dfb304f12f086d943417.tar.bz2
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
Diffstat (limited to 'gcc/stmt.c')
-rw-r--r--gcc/stmt.c4
1 files changed, 4 insertions, 0 deletions
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))