summaryrefslogtreecommitdiff
path: root/gcc/varasm.c
diff options
context:
space:
mode:
authorsje <sje@138bc75d-0d04-0410-961f-82ee72b054a4>2009-03-30 16:43:40 +0000
committersje <sje@138bc75d-0d04-0410-961f-82ee72b054a4>2009-03-30 16:43:40 +0000
commita7bc91811a4d6371c5c06dbd886307ba0388ebef (patch)
tree7886158a4e7de339c1bddbf1475cbceec18b4327 /gcc/varasm.c
parente2795ec4ecb9014ea2932e0cb42fd17ee096beb6 (diff)
downloadgcc-a7bc91811a4d6371c5c06dbd886307ba0388ebef.tar.gz
PR middle-end/38237
* tree.h (tree_find_value): New declaration. * tree.c (tree_find_value): New function. * varasm.c (assemble_external): Avoid duplicate entries on lists. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@145303 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/varasm.c')
-rw-r--r--gcc/varasm.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/gcc/varasm.c b/gcc/varasm.c
index e5b9f35fee9..9eefb02d8d9 100644
--- a/gcc/varasm.c
+++ b/gcc/varasm.c
@@ -2315,12 +2315,14 @@ assemble_external (tree decl ATTRIBUTE_UNUSED)
locally emitted, inlined or otherwise not-really-extern, but
for declarations that can be weak, it happens to be
match. */
- && !TREE_STATIC (decl))
- weak_decls = tree_cons (NULL, decl, weak_decls);
+ && !TREE_STATIC (decl)
+ && tree_find_value (weak_decls, decl) == NULL_TREE)
+ weak_decls = tree_cons (NULL, decl, weak_decls);
#ifdef ASM_OUTPUT_EXTERNAL
- pending_assemble_externals = tree_cons (0, decl,
- pending_assemble_externals);
+ if (tree_find_value (pending_assemble_externals, decl) == NULL_TREE)
+ pending_assemble_externals = tree_cons (NULL, decl,
+ pending_assemble_externals);
#endif
}