* varasm.c (notice_global_symbol): Properly deal with weak symbols.
authorJan Hubicka <jh@suse.cz>
Tue, 9 Sep 2003 13:37:17 +0000 (15:37 +0200)
committerJan Hubicka <hubicka@gcc.gnu.org>
Tue, 9 Sep 2003 13:37:17 +0000 (13:37 +0000)
From-SVN: r71236

gcc/ChangeLog
gcc/varasm.c

index 36a1b60..d103a85 100644 (file)
@@ -1,3 +1,7 @@
+Tue Sep  9 15:36:28 CEST 2003  Jan Hubicka  <jh@suse.cz>
+
+       * varasm.c (notice_global_symbol):  Properly deal with weak symbols.
+
 2003-09-08  Kelley Cook <kelleycook@wideopenwest.com>
 
        * Makefile.in: Revert yesterday's change.
index 84fbf25..d7c6068 100644 (file)
@@ -1048,11 +1048,11 @@ void
 notice_global_symbol (tree decl)
 {
   if ((!first_global_object_name || !weak_global_object_name)
-      && TREE_PUBLIC (decl)
+      && TREE_PUBLIC (decl) && !DECL_COMMON (decl)
       && (TREE_CODE (decl) == FUNCTION_DECL
-         || ! (DECL_COMMON (decl)
-               && (DECL_INITIAL (decl) == 0
-                   || DECL_INITIAL (decl) == error_mark_node))))
+         || (TREE_CODE (decl) == VAR_DECL
+             && (DECL_INITIAL (decl) != 0
+                 && DECL_INITIAL (decl) != error_mark_node))))
     {
       const char *p;
       char *name;