From: Roger Sayle Date: Mon, 13 Mar 2006 23:47:47 +0000 (+0000) Subject: re PR middle-end/26557 (ICE in simplify_subreg) X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=f831807967c55f828ba7dfb304f12f086d943417;p=gcc.git 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 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 94aac10fd99..8d28b2f835c 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2006-03-13 Roger Sayle + + 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. + 2006-03-13 John David Anglin * pa/pa32-linux.h (CRT_CALL_STATIC_FUNCTION): Define when CRTSTUFFS_O diff --git a/gcc/stmt.c b/gcc/stmt.c index d199398e55f..a3e3db3b3b6 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)) diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index f049f464d1b..b91ceeaadf3 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,10 +1,16 @@ +2006-03-13 Roger Sayle + + PR middle-end/26557 + * gcc.c-torture/compile/switch-1.c: New test case. + 2006-03-13 Paul Thomas PR fortran/25378 - * gfortran.fortran-torture/execute/intrinsic_mmloc_3.f90: Expand test to include more - permuatations of mask and index. - * testsuite/gfortran.dg/scalar_mask_1.f90: Modify last test to respond to F2003 spec. - that the position returned for an all false mask && condition is zero. + * gfortran.fortran-torture/execute/intrinsic_mmloc_3.f90: Expand + test to include more permuatations of mask and index. + * testsuite/gfortran.dg/scalar_mask_1.f90: Modify last test to + respond to F2003 spec. that the position returned for an all false + mask && condition is zero. 2006-03-13 Jakub Jelinek diff --git a/gcc/testsuite/gcc.c-torture/compile/switch-1.c b/gcc/testsuite/gcc.c-torture/compile/switch-1.c new file mode 100644 index 00000000000..cc71d30bb3f --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/compile/switch-1.c @@ -0,0 +1,9 @@ +/* PR middle-end/26557. */ +const int struct_test[1] = {1}; +void g(); +void f() { + switch(struct_test[0]) { + case 1: g(); + } +} +