c-decl.c (duplicate_decls): Avoid setting TREE_ASM_WRITTEN for duplicate declarations...
authorJeffrey A Law <law@cygnus.com>
Fri, 19 Jun 1998 00:05:02 +0000 (00:05 +0000)
committerJeff Law <law@gcc.gnu.org>
Fri, 19 Jun 1998 00:05:02 +0000 (18:05 -0600)
        * c-decl.c (duplicate_decls): Avoid setting TREE_ASM_WRITTEN for
        duplicate declarations of a function.

From-SVN: r20569

gcc/ChangeLog
gcc/c-decl.c

index 5b03002638cb2f0c6202b33807417698c48e22d0..faa14ec939e42398f45c57c35078d768c7409eb5 100644 (file)
@@ -1,3 +1,8 @@
+Fri Jun 19 01:02:17 1998  Jeffrey A Law  (law@cygnus.com)
+
+       * c-decl.c (duplicate_decls): Avoid setting TREE_ASM_WRITTEN for
+       duplicate declarations of a function.
+
 Fri Jun 19 00:33:33 1998  H.J. Lu  (hjl@gnu.org)
 
        * config/float-i386.h: New.
index 62768e3ef68be20423bcf9629cd56f2ab892e373..51a18c5a0dd437f6ff9aa487030a444579354ed3 100644 (file)
@@ -2007,8 +2007,15 @@ duplicate_decls (newdecl, olddecl, different_binding_level)
   if (different_binding_level)
     {
       /* Don't output a duplicate symbol or debugging information for this
-        declaration.  */
-      TREE_ASM_WRITTEN (newdecl) = DECL_IGNORED_P (newdecl) = 1;
+        declaration.
+
+        Do not set TREE_ASM_WRITTEN for a FUNCTION_DECL since we may actually
+        just have two declarations without a definition.  VAR_DECLs may need
+        the same treatment, I'm not sure.  */
+      if (TREE_CODE (newdecl) == FUNCTION_DECL)
+       DECL_IGNORED_P (newdecl) = 1;
+      else
+       TREE_ASM_WRITTEN (newdecl) = DECL_IGNORED_P (newdecl) = 1;
       return 0;
     }