diff options
author | Richard Henderson <rth@redhat.com> | 2002-05-26 03:38:37 +0000 |
---|---|---|
committer | Richard Henderson <rth@redhat.com> | 2002-05-26 03:38:37 +0000 |
commit | aa28cd840255e5e3ea6ef834439044d80999c055 (patch) | |
tree | c8dc7fde9389dae3158d0518dd428fab00360346 /gcc/c-pragma.c | |
parent | f3ea4236d6cbcf0120270eab378c2d8b41b0d892 (diff) |
* c-pragma.c (apply_pragma_weak): Convert value identifier to
string for decl_attributes.
(handle_pragma_weak): Call assemble_alias if we're modifying
an existing decl.
git-svn-id: https://gcc.gnu.org/svn/gcc/trunk@53884 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/c-pragma.c')
-rw-r--r-- | gcc/c-pragma.c | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/gcc/c-pragma.c b/gcc/c-pragma.c index 8801c697a8c..1a016b8b220 100644 --- a/gcc/c-pragma.c +++ b/gcc/c-pragma.c @@ -283,9 +283,14 @@ apply_pragma_weak (decl, value) tree decl, value; { if (value) - decl_attributes (&decl, build_tree_list (get_identifier ("alias"), - build_tree_list (NULL, value)), - 0); + { + value = build_string (IDENTIFIER_LENGTH (value), + IDENTIFIER_POINTER (value)); + decl_attributes (&decl, build_tree_list (get_identifier ("alias"), + build_tree_list (NULL, value)), + 0); + } + if (SUPPORTS_WEAK && DECL_EXTERNAL (decl) && TREE_USED (decl) && TREE_SYMBOL_REFERENCED (DECL_ASSEMBLER_NAME (decl))) warning_with_decl (decl, "applying #pragma weak `%s' after first use results in unspecified behavior"); @@ -342,7 +347,11 @@ handle_pragma_weak (dummy) decl = identifier_global_value (name); if (decl && TREE_CODE_CLASS (TREE_CODE (decl)) == 'd') - apply_pragma_weak (decl, value); + { + apply_pragma_weak (decl, value); + if (value) + assemble_alias (decl, value); + } else pending_weaks = tree_cons (name, value, pending_weaks); } |