aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2009-04-08 22:04:45 +0200
committerJakub Jelinek <jakub@gcc.gnu.org>2009-04-08 22:04:45 +0200
commit4f0ae266e0a4b49ee029b37934fa952e0bd66b6d (patch)
tree1f9294de165086bb00dcf11817a395d75138daaa
parentdead0bae538e7d7014947a7898aec6b5596f5e4a (diff)
downloadgcc-4f0ae266e0a4b49ee029b37934fa952e0bd66b6d.zip
gcc-4f0ae266e0a4b49ee029b37934fa952e0bd66b6d.tar.gz
gcc-4f0ae266e0a4b49ee029b37934fa952e0bd66b6d.tar.bz2
re PR middle-end/39573 (Linking fails on AMD with -march=native and -fopenmp, works with generic x86_64)
PR middle-end/39573 * omp-low.c (expand_omp_taskreg): Finalize taskreg static local_decls variables. * libgomp.c++/pr39573.C: New test. From-SVN: r145772
-rw-r--r--gcc/ChangeLog4
-rw-r--r--gcc/omp-low.c8
-rw-r--r--libgomp/ChangeLog5
-rw-r--r--libgomp/testsuite/libgomp.c++/pr39573.C39
4 files changed, 56 insertions, 0 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 5c09748..45ed3e5 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -5,6 +5,10 @@
(gen_variable_die): Use DW_TAG_member tag for static data member
declarations instead of DW_TAG_variable.
+ PR middle-end/39573
+ * omp-low.c (expand_omp_taskreg): Finalize taskreg static local_decls
+ variables.
+
2009-04-08 Richard Guenther <rguenther@suse.de>
* tree-ssa-sccvn.c (valueize_refs): Do not continue to
diff --git a/gcc/omp-low.c b/gcc/omp-low.c
index 551af40..b0066ed 100644
--- a/gcc/omp-low.c
+++ b/gcc/omp-low.c
@@ -3412,6 +3412,14 @@ expand_omp_taskreg (struct omp_region *region)
/* Declare local variables needed in CHILD_CFUN. */
block = DECL_INITIAL (child_fn);
BLOCK_VARS (block) = list2chain (child_cfun->local_decls);
+ /* The gimplifier could record temporaries in parallel/task block
+ rather than in containing function's local_decls chain,
+ which would mean cgraph missed finalizing them. Do it now. */
+ for (t = BLOCK_VARS (block); t; t = TREE_CHAIN (t))
+ if (TREE_CODE (t) == VAR_DECL
+ && TREE_STATIC (t)
+ && !DECL_EXTERNAL (t))
+ varpool_finalize_decl (t);
DECL_SAVED_TREE (child_fn) = NULL;
gimple_set_body (child_fn, bb_seq (single_succ (entry_bb)));
TREE_USED (block) = 1;
diff --git a/libgomp/ChangeLog b/libgomp/ChangeLog
index 15eb2c6c..3a6a7ed 100644
--- a/libgomp/ChangeLog
+++ b/libgomp/ChangeLog
@@ -1,3 +1,8 @@
+2009-04-08 Jakub Jelinek <jakub@redhat.com>
+
+ PR middle-end/39573
+ * libgomp.c++/pr39573.C: New test.
+
2009-04-01 Jakub Jelinek <jakub@redhat.com>
PR other/39591
diff --git a/libgomp/testsuite/libgomp.c++/pr39573.C b/libgomp/testsuite/libgomp.c++/pr39573.C
new file mode 100644
index 0000000..0167222
--- /dev/null
+++ b/libgomp/testsuite/libgomp.c++/pr39573.C
@@ -0,0 +1,39 @@
+// PR middle-end/39573
+// { dg-do run }
+
+int z;
+
+void __attribute__((noinline))
+bar (int *x)
+{
+ #pragma omp atomic
+ z += x[2];
+ x[2] += x[3];
+}
+
+int
+main ()
+{
+ int i;
+#pragma omp parallel for
+ for (i = 0; i < 65536; i++)
+ {
+ int x[] =
+ {
+ 0, 0, 0, 1, 0, 0, 1, 0, 1, 0, 0, 1, 0, 1, 0, 1, 1, 0, 1, 1, 1, 0, 1, 1,
+ 0, 0, 0, 1, 0, 0, 1, 0, 1, 0, 0, 1, 0, 1, 0, 1, 1, 0, 1, 1, 1, 0, 1, 1,
+ 0, 0, 0, 1, 0, 0, 1, 0, 1, 0, 0, 1, 0, 1, 0, 1, 1, 0, 1, 1, 1, 0, 1, 1,
+ 0, 0, 0, 1, 0, 0, 1, 0, 1, 0, 0, 1, 0, 1, 0, 1, 1, 0, 1, 1, 1, 0, 1, 1,
+ 0, 0, 0, 1, 0, 0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