diff options
author | jsm28 <jsm28@138bc75d-0d04-0410-961f-82ee72b054a4> | 2005-04-22 10:15:09 +0000 |
---|---|---|
committer | jsm28 <jsm28@138bc75d-0d04-0410-961f-82ee72b054a4> | 2005-04-22 10:15:09 +0000 |
commit | ea10cf3db684bc1b2670f5bfddac97ba67533195 (patch) | |
tree | 947d8bb4234906c7a01439784b99167a4a3bc891 /gcc | |
parent | 5629b19d22206dac9c44e65b7099bf89b94f0bc6 (diff) | |
download | gcc-ea10cf3db684bc1b2670f5bfddac97ba67533195.tar.gz |
* varasm.c (do_assemble_alias): Return early if TREE_ASM_WRITTEN
(decl).
testsuite:
* gcc.dg/weak/weak-13.c: New test.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@98551 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/testsuite/ChangeLog | 4 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/weak/weak-13.c | 13 | ||||
-rw-r--r-- | gcc/varasm.c | 3 |
4 files changed, 25 insertions, 0 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index d6dd3953ccc..c2ac0f4ad24 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -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 diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 61c9bf8c8bd..c55ee2428d1 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -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): diff --git a/gcc/testsuite/gcc.dg/weak/weak-13.c b/gcc/testsuite/gcc.dg/weak/weak-13.c new file mode 100644 index 00000000000..15106a5346b --- /dev/null +++ b/gcc/testsuite/gcc.dg/weak/weak-13.c @@ -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; diff --git a/gcc/varasm.c b/gcc/varasm.c index 832b55b1d1f..a3aa44aa0b7 100644 --- a/gcc/varasm.c +++ b/gcc/varasm.c @@ -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; |