summaryrefslogtreecommitdiff
path: root/gcc/c-decl.c
diff options
context:
space:
mode:
authorAlexandre Oliva <aoliva@redhat.com>2001-12-04 10:34:40 +0000
committerAlexandre Oliva <aoliva@gcc.gnu.org>2001-12-04 10:34:40 +0000
commit23700f650874c9406df42967f0ede7c3f203dc82 (patch)
tree5f796d4a540cf14b9ff9cbc2a69e91812776ca98 /gcc/c-decl.c
parent961eacce43e97fa61b625d38480a89927faa64d8 (diff)
downloadgcc-23700f650874c9406df42967f0ede7c3f203dc82.tar.gz
c-decl.c (duplicate_decls): Revert rth's patch.
* c-decl.c (duplicate_decls): Revert rth's patch. If newdecl is in a different binding level, get its abstract origin to be olddecl. * tree-inline.c (expand_call_inline): Move DECL_INITIAL sanity check earlier. * tree.c (get_callee_fndecl): Follow DECL_ABSTRACT_ORIGIN if DECL_INITIAL is NULL. From-SVN: r47610
Diffstat (limited to 'gcc/c-decl.c')
-rw-r--r--gcc/c-decl.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/gcc/c-decl.c b/gcc/c-decl.c
index 654e18438b8..34278546d97 100644
--- a/gcc/c-decl.c
+++ b/gcc/c-decl.c
@@ -2019,14 +2019,15 @@ duplicate_decls (newdecl, olddecl, different_binding_level)
DECL_INITIAL, so that we don't accidentally change function
declarations into function definitions. */
if (! different_binding_level)
- {
- DECL_INITIAL (newdecl) = DECL_INITIAL (olddecl);
- DECL_SAVED_TREE (newdecl) = DECL_SAVED_TREE (olddecl);
- }
+ DECL_INITIAL (newdecl) = DECL_INITIAL (olddecl);
DECL_SAVED_INSNS (newdecl) = DECL_SAVED_INSNS (olddecl);
+ DECL_SAVED_TREE (newdecl) = DECL_SAVED_TREE (olddecl);
DECL_ARGUMENTS (newdecl) = DECL_ARGUMENTS (olddecl);
if (DECL_INLINE (newdecl))
- DECL_ABSTRACT_ORIGIN (newdecl) = DECL_ABSTRACT_ORIGIN (olddecl);
+ DECL_ABSTRACT_ORIGIN (newdecl)
+ = (different_binding_level
+ ? DECL_ORIGIN (olddecl)
+ : DECL_ABSTRACT_ORIGIN (olddecl));
}
}
if (different_binding_level)