summaryrefslogtreecommitdiff
path: root/gcc/omp-expand.c
diff options
context:
space:
mode:
authorTom de Vries <tom@codesourcery.com>2017-12-30 17:02:00 +0000
committerTom de Vries <vries@gcc.gnu.org>2017-12-30 17:02:00 +0000
commit60bf575ccb787310f5f3063b036498de7e9c2c6b (patch)
tree1c337e37aa3127cc198dd0a948673450a1d8395f /gcc/omp-expand.c
parent1e4423dbb50bcafd41a1246602e4222d8562eb93 (diff)
Prune removed funcs from offload table
2017-12-30 Tom de Vries <tom@codesourcery.com> PR libgomp/83046 * omp-expand.c (expand_omp_target): If in_lto_p, mark offload_funcs with DECL_PRESERVE_P. * lto-streamer-out.c (prune_offload_funcs): New function. Remove offload_funcs entries that no longer have a corresponding cgraph_node. Mark the remaining ones as DECL_PRESERVE_P. (output_lto): Call prune_offload_funcs. * testsuite/libgomp.oacc-c-c++-common/pr83046.c: New test. * testsuite/libgomp.c-c++-common/pr83046.c: New test. From-SVN: r256045
Diffstat (limited to 'gcc/omp-expand.c')
-rw-r--r--gcc/omp-expand.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/gcc/omp-expand.c b/gcc/omp-expand.c
index 02488339b40..663711b3aa4 100644
--- a/gcc/omp-expand.c
+++ b/gcc/omp-expand.c
@@ -7058,7 +7058,11 @@ expand_omp_target (struct omp_region *region)
/* Add the new function to the offload table. */
if (ENABLE_OFFLOADING)
- vec_safe_push (offload_funcs, child_fn);
+ {
+ if (in_lto_p)
+ DECL_PRESERVE_P (child_fn) = 1;
+ vec_safe_push (offload_funcs, child_fn);
+ }
bool need_asm = DECL_ASSEMBLER_NAME_SET_P (current_function_decl)
&& !DECL_ASSEMBLER_NAME_SET_P (child_fn);