aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorRichard Stallman <rms@gnu.org>1992-09-07 06:57:50 +0000
committerRichard Stallman <rms@gnu.org>1992-09-07 06:57:50 +0000
commit850cba2976f2d33587954adae6590006289be618 (patch)
treeb5f908813c776e1c1811634e7cd6bef331e2b872 /gcc
parent08611787e305b57f080a1a5bda084fbf07ffdfa7 (diff)
downloadgcc-850cba2976f2d33587954adae6590006289be618.zip
gcc-850cba2976f2d33587954adae6590006289be618.tar.gz
gcc-850cba2976f2d33587954adae6590006289be618.tar.bz2
(duplicate_decls): Set DECL_INLINE in newdecl so it is copied into olddecl.
Don't set DECL_EXTERNAL in olddecl. Preserve DECL_UID of olddecl. From-SVN: r2074
Diffstat (limited to 'gcc')
-rw-r--r--gcc/c-decl.c16
1 files changed, 12 insertions, 4 deletions
diff --git a/gcc/c-decl.c b/gcc/c-decl.c
index fb92504..6a50539 100644
--- a/gcc/c-decl.c
+++ b/gcc/c-decl.c
@@ -1598,13 +1598,14 @@ duplicate_decls (newdecl, olddecl)
else
{
TREE_STATIC (olddecl) = TREE_STATIC (newdecl);
- DECL_EXTERNAL (olddecl) = 0;
TREE_PUBLIC (olddecl) = TREE_PUBLIC (newdecl);
}
+
/* If either decl says `inline', this fn is inline,
unless its definition was passed already. */
if (DECL_INLINE (newdecl) && DECL_INITIAL (olddecl) == 0)
DECL_INLINE (olddecl) = 1;
+ DECL_INLINE (newdecl) = DECL_INLINE (olddecl);
/* Get rid of any built-in function if new arg types don't match it
or if we have a function definition. */
@@ -1635,9 +1636,16 @@ duplicate_decls (newdecl, olddecl)
DECL_ARGUMENTS (newdecl) = DECL_ARGUMENTS (olddecl);
}
- bcopy ((char *) newdecl + sizeof (struct tree_common),
- (char *) olddecl + sizeof (struct tree_common),
- sizeof (struct tree_decl) - sizeof (struct tree_common));
+ /* Copy most of the decl-specific fields of NEWDECL into OLDDECL.
+ But preserve OLDdECL's DECL_UID. */
+ {
+ register unsigned olddecl_uid = DECL_UID (olddecl);
+
+ bcopy ((char *) newdecl + sizeof (struct tree_common),
+ (char *) olddecl + sizeof (struct tree_common),
+ sizeof (struct tree_decl) - sizeof (struct tree_common));
+ DECL_UID (olddecl) = olddecl_uid;
+ }
return 1;
}