OSDN Git Service

PR middle-end/38676
authorjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 30 Dec 2008 23:20:45 +0000 (23:20 +0000)
committerjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 30 Dec 2008 23:20:45 +0000 (23:20 +0000)
* gimplify.c (gimple_regimplify_operands): For GIMPLE_SWITCH
only regimplify switch index.

* gcc.dg/gomp/pr38676.c: New test.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@142970 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ChangeLog
gcc/gimplify.c
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/gomp/pr38676.c [new file with mode: 0644]

index d680ff7..adff086 100644 (file)
@@ -1,3 +1,9 @@
+2008-12-31  Jakub Jelinek  <jakub@redhat.com>
+
+       PR middle-end/38676
+       * gimplify.c (gimple_regimplify_operands): For GIMPLE_SWITCH
+       only regimplify switch index.
+
 2008-12-30  Richard Guenther  <rguenther@suse.de>
 
        PR tree-optimization/38645
index e000241..5aef128 100644 (file)
@@ -7380,6 +7380,10 @@ gimple_regimplify_operands (gimple stmt, gimple_stmt_iterator *gsi_p)
       gimplify_expr (gimple_cond_rhs_ptr (stmt), &pre, NULL,
                     is_gimple_val, fb_rvalue);
       break;
+    case GIMPLE_SWITCH:
+      gimplify_expr (gimple_switch_index_ptr (stmt), &pre, NULL,
+                    is_gimple_val, fb_rvalue);
+      break;
     case GIMPLE_OMP_ATOMIC_LOAD:
       gimplify_expr (gimple_omp_atomic_load_rhs_ptr (stmt), &pre, NULL,
                     is_gimple_val, fb_rvalue);
index 969273e..1464523 100644 (file)
@@ -1,3 +1,8 @@
+2008-12-31  Jakub Jelinek  <jakub@redhat.com>
+
+       PR middle-end/38676
+       * gcc.dg/gomp/pr38676.c: New test.
+
 2008-12-30  Richard Guenther  <rguenther@suse.de>
 
        PR tree-optimization/38645
diff --git a/gcc/testsuite/gcc.dg/gomp/pr38676.c b/gcc/testsuite/gcc.dg/gomp/pr38676.c
new file mode 100644 (file)
index 0000000..cd93120
--- /dev/null
@@ -0,0 +1,19 @@
+/* PR middle-end/38676 */
+/* { dg-do compile } */
+/* { dg-options "-fopenmp" } */
+
+int
+main ()
+{
+  int bar, foo = 1;
+#pragma omp parallel for shared(foo)
+  for (bar = 0; bar < 3; bar++)
+    {
+      switch (foo)
+       {
+       case 1:
+         break;
+       }
+    }
+  return 0;
+}