]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
re PR middle-end/11397 (weak aliases broken on Tru64 UNIX)
authorRoger Sayle <roger@eyesopen.com>
Mon, 12 Jan 2004 18:23:08 +0000 (18:23 +0000)
committerRoger Sayle <sayle@gcc.gnu.org>
Mon, 12 Jan 2004 18:23:08 +0000 (18:23 +0000)
PR middle-end/11397
* varasm.c (assemble_alias): Remove weak aliases from weak_decls.

From-SVN: r75740

gcc/ChangeLog
gcc/varasm.c

index d6a2c907d6b989936ca89949986b784dee1319f9..fb0f28c7a5e044af535a00725271abd8c4ce2f3a 100644 (file)
@@ -1,3 +1,8 @@
+2004-01-12  Roger Sayle  <roger@eyesopen.com>
+
+       PR middle-end/11397
+       * varasm.c (assemble_alias): Remove weak aliases from weak_decls.
+
 2004-01-12  J"orn Rennecke <joern.rennecke@superh.com>
 
        PR target/13585
index 9a760998f620b50aadff8c033c3810b5cd5053ac..508118627c4e5f2154677ba5b44466c9aad15115 100644 (file)
@@ -1,6 +1,6 @@
 /* Output variables, constants and external declarations, for GNU compiler.
    Copyright (C) 1987, 1988, 1989, 1992, 1993, 1994, 1995, 1996, 1997,
-   1998, 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
+   1998, 1999, 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
 
 This file is part of GCC.
 
@@ -4673,14 +4673,26 @@ assemble_alias (decl, target)
 #endif
 #else /* !ASM_OUTPUT_DEF */
 #if defined (ASM_OUTPUT_WEAK_ALIAS) || defined (ASM_WEAKEN_DECL)
-  if (DECL_WEAK (decl))
-    warning ("only weak aliases are supported in this configuration");
-
+  if (DECL_WEAK (decl))
+    {
+      tree *p, t;
 #ifdef ASM_WEAKEN_DECL
-  ASM_WEAKEN_DECL (asm_out_file, decl, name, IDENTIFIER_POINTER (target));
+      ASM_WEAKEN_DECL (asm_out_file, decl, name, IDENTIFIER_POINTER (target));
 #else
-  ASM_OUTPUT_WEAK_ALIAS (asm_out_file, name, IDENTIFIER_POINTER (target));
+      ASM_OUTPUT_WEAK_ALIAS (asm_out_file, name, IDENTIFIER_POINTER (target));
 #endif
+      /* Remove this function from the pending weak list so that
+        we do not emit multiple .weak directives for it.  */
+      for (p = &weak_decls; (t = *p) ; )
+       if (DECL_ASSEMBLER_NAME (decl)
+           == DECL_ASSEMBLER_NAME (TREE_VALUE (t)))
+         *p = TREE_CHAIN (t);
+       else
+         p = &TREE_CHAIN (t);
+    }
+  else
+    warning ("only weak aliases are supported in this configuration");
+
 #else
   warning ("alias definitions not supported in this configuration; ignored");
 #endif