summaryrefslogtreecommitdiff
path: root/gcc/c-decl.c
diff options
context:
space:
mode:
authorsirl <sirl@138bc75d-0d04-0410-961f-82ee72b054a4>2002-04-28 18:31:34 +0000
committersirl <sirl@138bc75d-0d04-0410-961f-82ee72b054a4>2002-04-28 18:31:34 +0000
commit296c463e520419ac1adf0f5a90fd4c7470130451 (patch)
treebf07a3136b537dc0844e7c227d87d6ade6e858ef /gcc/c-decl.c
parent2493f5d5862475a536a05867536687c5cdacd8b2 (diff)
downloadgcc-296c463e520419ac1adf0f5a90fd4c7470130451.tar.gz
2002-04-28 Franz Sirl <Franz.Sirl-kernel@lauterbach.com>
PR c/6343 * c-decl.c (duplicate_decls): Call merge_weak. * c-pragma.c (apply_pragma_weak): Warn about misuse. * output.h (merge_weak): Prototype merge_weak. * varasm.c (merge_weak): New function. (declare_weak): Make sure we don't give an error on VAR_DECLs. Mark RTL with SYMBOL_REF_WEAK. cp: * decl.c (duplicate_decls): Call merge_weak. testsuite: * gcc.dg/weak-[2-7].c: New tests. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@52844 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/c-decl.c')
-rw-r--r--gcc/c-decl.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/gcc/c-decl.c b/gcc/c-decl.c
index 9cef1874dc6..0898613ed9a 100644
--- a/gcc/c-decl.c
+++ b/gcc/c-decl.c
@@ -1843,7 +1843,8 @@ duplicate_decls (newdecl, olddecl, different_binding_level)
}
/* Merge the storage class information. */
- DECL_WEAK (newdecl) |= DECL_WEAK (olddecl);
+ merge_weak (newdecl, olddecl);
+
/* For functions, static overrides non-static. */
if (TREE_CODE (newdecl) == FUNCTION_DECL)
{