varasm.c (do_assemble_alias): Return early if TREE_ASM_WRITTEN (decl).

* varasm.c (do_assemble_alias): Return early if TREE_ASM_WRITTEN
	(decl).

testsuite:
	* gcc.dg/weak/weak-13.c: New test.

From-SVN: r98551
This commit is contained in:
Joseph Myers 2005-04-22 11:15:09 +01:00 committed by Joseph Myers
parent acb217cbc9
commit ebccb65d5a
4 changed files with 25 additions and 0 deletions

View File

@ -1,3 +1,8 @@
2005-04-22 Joseph S. Myers <joseph@codesourcery.com>
* varasm.c (do_assemble_alias): Return early if TREE_ASM_WRITTEN
(decl).
2005-04-22 Nathan Sidwell <nathan@codesourcery.com>
* config/i386/i386.md (length_immediate): Use gcc_assert or

View File

@ -1,3 +1,7 @@
2005-04-22 Joseph S. Myers <joseph@codesourcery.com>
* gcc.dg/weak/weak-13.c: New test.
2005-04-21 Geoffrey Keating <geoffk@apple.com>
* lib/target-supports.exp (check_effective_target_sync_int_long):

View File

@ -0,0 +1,13 @@
/* Test for weak aliases with multiple declarations. Sun assembler
rejects multiple weak alias definitions in the output. */
/* { dg-do assemble } */
/* { dg-require-weak "" } */
/* { dg-require-alias "" } */
/* { dg-options "" } */
#pragma weak foo = _foo
extern int foo;
extern int foo;
int _foo = 4;

View File

@ -4486,6 +4486,9 @@ find_decl_and_mark_needed (tree decl, tree target)
static void
do_assemble_alias (tree decl, tree target ATTRIBUTE_UNUSED)
{
if (TREE_ASM_WRITTEN (decl))
return;
TREE_ASM_WRITTEN (decl) = 1;
TREE_ASM_WRITTEN (DECL_ASSEMBLER_NAME (decl)) = 1;