aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog6
-rw-r--r--gcc/stmt.c4
-rw-r--r--gcc/testsuite/ChangeLog14
-rw-r--r--gcc/testsuite/gcc.c-torture/compile/switch-1.c9
4 files changed, 29 insertions, 4 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 94aac10..8d28b2f 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,9 @@
+2006-03-13 Roger Sayle <roger@eyesopen.com>
+
+ 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 <dave.anglin@nrc-cnrc.gc.ca>
* pa/pa32-linux.h (CRT_CALL_STATIC_FUNCTION): Define when CRTSTUFFS_O
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))
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index f049f46..b91ceea 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,10 +1,16 @@
+2006-03-13 Roger Sayle <roger@eyesopen.com>
+
+ PR middle-end/26557
+ * gcc.c-torture/compile/switch-1.c: New test case.
+
2006-03-13 Paul Thomas <pault@gcc.gnu.org>
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 <jakub@redhat.com>
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 0000000..cc71d30
--- /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();
+ }
+}
+