summaryrefslogtreecommitdiff
path: root/gcc/tree-inline.c
diff options
context:
space:
mode:
authorAlexandre Oliva <aoliva@redhat.com>2001-12-06 17:58:23 +0000
committerAlexandre Oliva <aoliva@gcc.gnu.org>2001-12-06 17:58:23 +0000
commita1a0fd4e18b29805534aa56e3910202395a792c3 (patch)
tree342c2184b8a04c1adf1d194029cf16c2c08e77bb /gcc/tree-inline.c
parent441f30d998ed4cc2e7806b80918d8e11fecd6dd6 (diff)
downloadgcc-a1a0fd4e18b29805534aa56e3910202395a792c3.tar.gz
tree.c (get_callee_fndecl): Move DECL_ABSTRACT_ORIGIN-following...
* tree.c (get_callee_fndecl): Move DECL_ABSTRACT_ORIGIN-following... * tree-inline.c (expand_call_inline): ... here. From-SVN: r47725
Diffstat (limited to 'gcc/tree-inline.c')
-rw-r--r--gcc/tree-inline.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/gcc/tree-inline.c b/gcc/tree-inline.c
index 1444edf10ea..6cd1fbb5e15 100644
--- a/gcc/tree-inline.c
+++ b/gcc/tree-inline.c
@@ -807,6 +807,18 @@ expand_call_inline (tp, walk_subtrees, data)
if (!fn)
return NULL_TREE;
+ /* If fn is a declaration of a function in a nested scope that was
+ globally declared inline, we don't set its DECL_INITIAL.
+ However, we can't blindly follow DECL_ABSTRACT_ORIGIN because the
+ C++ front-end uses it for cdtors to refer to their internal
+ declarations, that are not real functions. Fortunately those
+ don't have trees to be saved, so we can tell by checking their
+ DECL_SAVED_TREE. */
+ if (! DECL_INITIAL (fn)
+ && DECL_ABSTRACT_ORIGIN (fn)
+ && DECL_SAVED_TREE (DECL_ABSTRACT_ORIGIN (fn)))
+ fn = DECL_ABSTRACT_ORIGIN (fn);
+
/* Don't try to inline functions that are not well-suited to
inlining. */
if (!inlinable_function_p (fn, id))