From 4f0ae266e0a4b49ee029b37934fa952e0bd66b6d Mon Sep 17 00:00:00 2001 From: Jakub Jelinek Date: Wed, 8 Apr 2009 22:04:45 +0200 Subject: 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 --- gcc/omp-low.c | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'gcc/omp-low.c') 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; -- cgit v1.1