OSDN Git Service

PR middle-end/38633
authorjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>
Sat, 27 Dec 2008 15:38:22 +0000 (15:38 +0000)
committerjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>
Sat, 27 Dec 2008 15:38:22 +0000 (15:38 +0000)
* tree-cfg.c (replace_block_vars_by_duplicates): Only call
replace_by_duplicate_decl for VAR_DECLs or CONST_DECLs.

* gcc.dg/gomp/pr38633.c: New test.
* g++.dg/gomp/pr38633.C: New test.

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

gcc/ChangeLog
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/gomp/pr38633.C [new file with mode: 0644]
gcc/testsuite/gcc.dg/gomp/pr38633.c [new file with mode: 0644]
gcc/tree-cfg.c

index c2fda35..2c08722 100644 (file)
@@ -1,3 +1,9 @@
+2008-12-27  Jakub Jelinek  <jakub@redhat.com>
+
+       PR middle-end/38633
+       * tree-cfg.c (replace_block_vars_by_duplicates): Only call
+       replace_by_duplicate_decl for VAR_DECLs or CONST_DECLs.
+
 2008-12-24  Kazu Hirata  <kazu@codesourcery.com>
 
        * Makefile.in (GTFILES): Add $(srcdir)/expr.h.
index fb334fb..7f5c20c 100644 (file)
@@ -1,5 +1,9 @@
 2008-12-27  Jakub Jelinek  <jakub@redhat.com>
 
+       PR middle-end/38633
+       * gcc.dg/gomp/pr38633.c: New test.
+       * g++.dg/gomp/pr38633.C: New test.
+
        PR c++/38639
        * g++.dg/gomp/pr38639.C: New test.
 
diff --git a/gcc/testsuite/g++.dg/gomp/pr38633.C b/gcc/testsuite/g++.dg/gomp/pr38633.C
new file mode 100644 (file)
index 0000000..99b8795
--- /dev/null
@@ -0,0 +1,14 @@
+// PR middle-end/38633
+// { dg-do compile }
+// { dg-options "-fopenmp" }
+
+void
+foo ()
+{
+#pragma omp parallel
+  {
+    struct A { int i; } j;
+    j.i = 6;
+    j.i++;
+  }
+}
diff --git a/gcc/testsuite/gcc.dg/gomp/pr38633.c b/gcc/testsuite/gcc.dg/gomp/pr38633.c
new file mode 100644 (file)
index 0000000..6c96bd1
--- /dev/null
@@ -0,0 +1,14 @@
+/* PR middle-end/38633 */
+/* { dg-do compile } */
+/* { dg-options "-fopenmp" } */
+
+void
+foo ()
+{
+#pragma omp parallel
+  {
+    struct A { int i; } j;
+    j.i = 6;
+    j.i++;
+  }
+}
index 89621f0..b300c53 100644 (file)
@@ -5835,6 +5835,8 @@ replace_block_vars_by_duplicates (tree block, struct pointer_map_t *vars_map,
   for (tp = &BLOCK_VARS (block); *tp; tp = &TREE_CHAIN (*tp))
     {
       t = *tp;
+      if (TREE_CODE (t) != VAR_DECL && TREE_CODE (t) != CONST_DECL)
+       continue;
       replace_by_duplicate_decl (&t, vars_map, to_context);
       if (t != *tp)
        {