]> gcc.gnu.org Git - gcc.git/commitdiff
re PR c/26171 (#pragma omp threadprivate requires -funit-at-a-time)
authorJakub Jelinek <jakub@redhat.com>
Wed, 26 Apr 2006 08:26:06 +0000 (10:26 +0200)
committerJakub Jelinek <jakub@gcc.gnu.org>
Wed, 26 Apr 2006 08:26:06 +0000 (10:26 +0200)
PR c/26171
* cgraph.c (cgraph_varpool_finalize_decl): Don't call
cgraph_varpool_assemble_pending_decls if -fopenmp, unless
cgraph_global_info_ready.

* testsuite/libgomp.c/pr26171.c: New test.

From-SVN: r113271

gcc/ChangeLog
gcc/cgraph.c
libgomp/ChangeLog
libgomp/testsuite/libgomp.c/pr26171.c [new file with mode: 0644]

index ebec042da7028acb5b1e15cdcae33551cadaf174..591ca4b753390f49a64a253584f64867cd12bcad 100644 (file)
@@ -1,5 +1,10 @@
 2006-04-26  Jakub Jelinek  <jakub@redhat.com>
 
+       PR c/26171
+       * cgraph.c (cgraph_varpool_finalize_decl): Don't call
+       cgraph_varpool_assemble_pending_decls if -fopenmp, unless
+       cgraph_global_info_ready.
+
        PR middle-end/26913
        * tree-cfg.c (find_outermost_region_in_block): Handle RESX_EXPR.
 
index 6a8ac08aeff4602cdb3b6bee11de74b77b4a8c6a..301de31542653552cefd98ca4605f0b74a0cb98b 100644 (file)
@@ -886,7 +886,7 @@ cgraph_varpool_finalize_decl (tree decl)
      if this function has already run.  */
   if (node->finalized)
     {
-      if (cgraph_global_info_ready || !flag_unit_at_a_time)
+      if (cgraph_global_info_ready || (!flag_unit_at_a_time && !flag_openmp))
        cgraph_varpool_assemble_pending_decls ();
       return;
     }
@@ -901,7 +901,7 @@ cgraph_varpool_finalize_decl (tree decl)
      there.  */
   else if (TREE_PUBLIC (decl) && !DECL_COMDAT (decl) && !DECL_EXTERNAL (decl))
     cgraph_varpool_mark_needed_node (node);
-  if (cgraph_global_info_ready || !flag_unit_at_a_time)
+  if (cgraph_global_info_ready || (!flag_unit_at_a_time && !flag_openmp))
     cgraph_varpool_assemble_pending_decls ();
 }
 
index 41b3a09536fe9a4172d8e7ddcf53f99d99a539a0..657b7ea042516768a4b14e406f43fe8d23a37e57 100644 (file)
@@ -1,3 +1,8 @@
+2006-04-26  Jakub Jelinek  <jakub@redhat.com>
+
+       PR c/26171
+       * testsuite/libgomp.c/pr26171.c: New test.
+
 2006-04-25  Richard Henderson  <rth@redhat.com>
 
        PR libgomp/25865
diff --git a/libgomp/testsuite/libgomp.c/pr26171.c b/libgomp/testsuite/libgomp.c/pr26171.c
new file mode 100644 (file)
index 0000000..eacc9a7
--- /dev/null
@@ -0,0 +1,14 @@
+/* PR c/26171 */
+/* { dg-do run } */
+/* { dg-options "-fopenmp" } */
+/* { dg-require-effective-target tls_runtime } */
+
+int thrv = 0;
+#pragma omp threadprivate (thrv)
+
+int
+main ()
+{
+  thrv = 1;
+  return 0;
+}
This page took 0.077414 seconds and 5 git commands to generate.