diff options
Diffstat (limited to 'gcc/c-decl.c')
-rw-r--r-- | gcc/c-decl.c | 38 |
1 files changed, 20 insertions, 18 deletions
diff --git a/gcc/c-decl.c b/gcc/c-decl.c index a2118fd..0f104a4 100644 --- a/gcc/c-decl.c +++ b/gcc/c-decl.c @@ -1928,19 +1928,6 @@ 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. */ @@ -1974,12 +1961,27 @@ duplicate_decls (newdecl, olddecl, different_binding_level) if (TREE_CODE (newdecl) == FUNCTION_DECL) { - /* 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; + /* 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); - DECL_INLINE (newdecl) = DECL_INLINE (olddecl); + /* The new defn must not be inline. */ + DECL_INLINE (newdecl) = 0; + DECL_UNINLINABLE (newdecl) = 1; + } + else + { + /* 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); + } if (DECL_BUILT_IN (olddecl)) { |