diff options
author | Tobias Burnus <tobias@codesourcery.com> | 2020-03-23 14:41:58 +0100 |
---|---|---|
committer | Tobias Burnus <tobias@codesourcery.com> | 2020-03-23 14:41:58 +0100 |
commit | ce6413087deba5888a0a9a24f95f3b796e46add9 (patch) | |
tree | 95cc758215c6f4f2bc8cebd269801d500eb81d2c /gcc | |
parent | a3586eeb88414e77c7cccb69362b8d04562536b6 (diff) | |
download | gcc-ce6413087deba5888a0a9a24f95f3b796e46add9.zip gcc-ce6413087deba5888a0a9a24f95f3b796e46add9.tar.gz gcc-ce6413087deba5888a0a9a24f95f3b796e46add9.tar.bz2 |
lto/lto.c – used $ or . in generated linkptr name
* lto.c (offload_handle_link_vars): Reduce chance of
naming clashes of generated linkptr variable.
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/lto/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/lto/lto.c | 6 |
2 files changed, 7 insertions, 4 deletions
diff --git a/gcc/lto/ChangeLog b/gcc/lto/ChangeLog index 333f2a3..b3c2138 100644 --- a/gcc/lto/ChangeLog +++ b/gcc/lto/ChangeLog @@ -1,5 +1,10 @@ 2020-01-29 Tobias Burnus <tobias@codesourcery.com> + * lto.c (offload_handle_link_vars): Reduce chance of + naming clashes of generated linkptr variable. + +2020-01-29 Tobias Burnus <tobias@codesourcery.com> + PR middle-end/94233 * lto.c (offload_handle_link_vars): Cleanup; call build_decl to ensure alignment is set. diff --git a/gcc/lto/lto.c b/gcc/lto/lto.c index 467b922..cd34d6c 100644 --- a/gcc/lto/lto.c +++ b/gcc/lto/lto.c @@ -561,11 +561,9 @@ offload_handle_link_vars (void) DECL_ATTRIBUTES (var->decl))) { tree type = build_pointer_type (TREE_TYPE (var->decl)); - tree var_name = DECL_ASSEMBLER_NAME (var->decl); - char *new_name - = ACONCAT ((IDENTIFIER_POINTER (var_name), "_linkptr", NULL)); tree link_ptr_var = build_decl (UNKNOWN_LOCATION, VAR_DECL, - get_identifier (new_name), type); + clone_function_name (var->decl, + "linkptr"), type); TREE_USED (link_ptr_var) = 1; TREE_STATIC (link_ptr_var) = 1; DECL_ARTIFICIAL (link_ptr_var) = 1; |