summaryrefslogtreecommitdiff
path: root/gcc/varasm.c
diff options
context:
space:
mode:
authorSteve Ellcey <sje@cup.hp.com>2009-03-30 16:43:40 +0000
committerSteve Ellcey <sje@gcc.gnu.org>2009-03-30 16:43:40 +0000
commitf4d9f129fe9884da7b5f92f919a22157f729c577 (patch)
tree7886158a4e7de339c1bddbf1475cbceec18b4327 /gcc/varasm.c
parentbe21df036cb6a1d91d0016e6f66889b5ff5e9a5d (diff)
downloadgcc-f4d9f129fe9884da7b5f92f919a22157f729c577.tar.gz
re PR middle-end/38237 (multiple weak directives)
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. From-SVN: r145303
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
}