stmt.c (expand_start_case): Call emit_queue ().
authorJakub Jelinek <jakub@redhat.com>
Fri, 14 Mar 2003 17:53:51 +0000 (18:53 +0100)
committerJakub Jelinek <jakub@gcc.gnu.org>
Fri, 14 Mar 2003 17:53:51 +0000 (18:53 +0100)
* stmt.c (expand_start_case): Call emit_queue ().

* gcc.c-torture/execute/20030313-1.c: New test.

From-SVN: r64366

gcc/ChangeLog
gcc/stmt.c
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.c-torture/execute/20030313-1.c [new file with mode: 0644]

index 75a31316d160052cc63ff3f7cd4ff76fcff4dfa2..fced2cbbf01fd62d533cfce46f1d2487e92dea57 100644 (file)
@@ -1,3 +1,7 @@
+2003-03-14  Jakub Jelinek  <jakub@redhat.com>
+
+       * stmt.c (expand_start_case): Call emit_queue ().
+
 2003-03-14  Chris Demetriou  <cgd@broadcom.com>, Alexandre Oliva  <aoliva@redhat.com>
 
        * config/mips/mips.h (FUNCTION_PROFILER): _mcount() doesn't pop 2
index ea21a6dc80b34caf5e42860ce599b0c6d4a0c79e..7e5ff1abb3b39c1980c1962e458e8ac29a53e33e 100644 (file)
@@ -4431,6 +4431,7 @@ expand_start_case (exit_flag, expr, type, printname)
   nesting_stack = thiscase;
 
   do_pending_stack_adjust ();
+  emit_queue ();
 
   /* Make sure case_stmt.start points to something that won't
      need any transformation before expand_end_case.  */
index 57311c7a496bab29425beca888e3e3142a34ae01..75049056c022d972b27db91fe2c07363d3fde572 100644 (file)
@@ -1,3 +1,7 @@
+2003-03-14  Jakub Jelinek  <jakub@redhat.com>
+
+       * gcc.c-torture/execute/20030313-1.c: New test.
+
 2003-03-14  Richard Henderson  <rth@redhat.com>
 
        * gcc.dg/inline-2.c: Adjust alpha test for external call.
diff --git a/gcc/testsuite/gcc.c-torture/execute/20030313-1.c b/gcc/testsuite/gcc.c-torture/execute/20030313-1.c
new file mode 100644 (file)
index 0000000..49245a0
--- /dev/null
@@ -0,0 +1,68 @@
+struct A
+{
+  unsigned long p, q, r, s;
+} x = { 13, 14, 15, 16 };
+
+extern void abort (void);
+extern void exit (int);
+
+static inline struct A *
+bar (void)
+{
+  struct A *r;
+
+  switch (8)
+    {
+    case 2:
+      abort ();
+      break;
+    case 8:
+      r = &x;
+      break;
+    default:
+      abort ();
+      break;
+    }
+  return r;
+}
+
+void
+foo (unsigned long *x, int y)
+{
+  if (y != 12)
+    abort ();
+  if (x[0] != 1 || x[1] != 11)
+    abort ();
+  if (x[2] != 2 || x[3] != 12)
+    abort ();
+  if (x[4] != 3 || x[5] != 13)
+    abort ();
+  if (x[6] != 4 || x[7] != 14)
+    abort ();
+  if (x[8] != 5 || x[9] != 15)
+    abort ();
+  if (x[10] != 6 || x[11] != 16)
+    abort ();
+}
+
+int
+main (void)
+{
+  unsigned long a[40];
+  int b = 0;
+
+  a[b++] = 1;
+  a[b++] = 11;
+  a[b++] = 2;
+  a[b++] = 12;
+  a[b++] = 3;
+  a[b++] = bar()->p;
+  a[b++] = 4;
+  a[b++] = bar()->q;
+  a[b++] = 5;
+  a[b++] = bar()->r;
+  a[b++] = 6;
+  a[b++] = bar()->s;
+  foo (a, b);
+  exit (0);
+}