re PR c/6343 (attribute((weak)) not working on second declaration)
authorFranz Sirl <Franz.Sirl-kernel@lauterbach.com>
Sun, 28 Apr 2002 18:31:34 +0000 (18:31 +0000)
committerFranz Sirl <sirl@gcc.gnu.org>
Sun, 28 Apr 2002 18:31:34 +0000 (18:31 +0000)
commit45806a3fd4f324c7050b26980f282e1a4ef8961e
treebf07a3136b537dc0844e7c227d87d6ade6e858ef
parent32c8d10081ea8d106b1bf83f0ce13480c9e36910
re PR c/6343 (attribute((weak)) not working on second declaration)

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.

From-SVN: r52844
14 files changed:
gcc/ChangeLog
gcc/c-decl.c
gcc/c-pragma.c
gcc/cp/ChangeLog
gcc/cp/decl.c
gcc/output.h
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/weak-2.c [new file with mode: 0644]
gcc/testsuite/gcc.dg/weak-3.c [new file with mode: 0644]
gcc/testsuite/gcc.dg/weak-4.c [new file with mode: 0644]
gcc/testsuite/gcc.dg/weak-5.c [new file with mode: 0644]
gcc/testsuite/gcc.dg/weak-6.c [new file with mode: 0644]
gcc/testsuite/gcc.dg/weak-7.c [new file with mode: 0644]
gcc/varasm.c