summaryrefslogtreecommitdiff
path: root/gcc/c-decl.c
diff options
context:
space:
mode:
authorjason <jason@138bc75d-0d04-0410-961f-82ee72b054a4>2001-02-16 13:03:10 +0000
committerjason <jason@138bc75d-0d04-0410-961f-82ee72b054a4>2001-02-16 13:03:10 +0000
commitf414ade28263516299b50fbfd3c78b814875c493 (patch)
tree5ae76ee139c95d2ba34d0cb6fa406f2f92e70519 /gcc/c-decl.c
parent7b7cc58a14ae9e2f194cec0ec7767aceb1ed4be6 (diff)
downloadgcc-f414ade28263516299b50fbfd3c78b814875c493.tar.gz
* dwarf2out.c (add_bound_info): Don't crash if SAVE_EXPR_RTL is
NULL. (gen_subprogram_die): Don't abort on seeing a second definition if the previous one was abstract. Don't replace an abstract instance in the lookup table. * dwarf2out.c (dwarf2out_abstract_function): Rename from gen_abstract_function. * dwarf2out.h: Declare it. * toplev.c (note_outlining_of_inline_function): New fn. * toplev.h: Declare it. * integrate.c (output_inline_function): Call it. * c-decl.c (duplicate_decls): Call it when redefining an extern inline. Don't inline the new defn. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@39763 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/c-decl.c')
-rw-r--r--gcc/c-decl.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/gcc/c-decl.c b/gcc/c-decl.c
index f0d229db69d..a2118fdfdc1 100644
--- a/gcc/c-decl.c
+++ b/gcc/c-decl.c
@@ -1928,6 +1928,19 @@ duplicate_decls (newdecl, olddecl, different_binding_level)
/* For functions, static overrides non-static. */
if (TREE_CODE (newdecl) == FUNCTION_DECL)
{
+ /* If we're redefining a function previously defined as extern
+ inline, make sure we emit debug info for the inline before we
+ throw it away, in case it was inlined into a function that hasn't
+ been written out yet. */
+ if (new_is_definition && DECL_INITIAL (olddecl) && TREE_USED (olddecl))
+ {
+ note_outlining_of_inline_function (olddecl);
+
+ /* The new defn must not be inline.
+ FIXME what about -finline-functions? */
+ DECL_INLINE (newdecl) = 0;
+ }
+
TREE_PUBLIC (newdecl) &= TREE_PUBLIC (olddecl);
/* This is since we don't automatically
copy the attributes of NEWDECL into OLDDECL. */