diff options
| author | aoliva <aoliva@138bc75d-0d04-0410-961f-82ee72b054a4> | 2001-12-06 17:58:23 +0000 |
|---|---|---|
| committer | aoliva <aoliva@138bc75d-0d04-0410-961f-82ee72b054a4> | 2001-12-06 17:58:23 +0000 |
| commit | ad850f1c81cff7a6254dd93c1f07fba2e5aaa937 (patch) | |
| tree | 342c2184b8a04c1adf1d194029cf16c2c08e77bb | |
| parent | a35b144de578954c2577999913480f7880fe2404 (diff) | |
| download | ppe42-gcc-ad850f1c81cff7a6254dd93c1f07fba2e5aaa937.tar.gz ppe42-gcc-ad850f1c81cff7a6254dd93c1f07fba2e5aaa937.zip | |
* tree.c (get_callee_fndecl): Move DECL_ABSTRACT_ORIGIN-following...
* tree-inline.c (expand_call_inline): ... here.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@47725 138bc75d-0d04-0410-961f-82ee72b054a4
| -rw-r--r-- | gcc/ChangeLog | 5 | ||||
| -rw-r--r-- | gcc/tree-inline.c | 12 | ||||
| -rw-r--r-- | gcc/tree.c | 18 |
3 files changed, 18 insertions, 17 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 6ce3c3b6a69..1714191b078 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2001-12-06 Alexandre Oliva <aoliva@redhat.com> + + * tree.c (get_callee_fndecl): Move DECL_ABSTRACT_ORIGIN-following... + * tree-inline.c (expand_call_inline): ... here. + 2001-12-06 H.J. Lu <hjl@gnu.org> * Makefile.in (.po.gmo): Use "-mkdir po" for parallel build. 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)) diff --git a/gcc/tree.c b/gcc/tree.c index c21f9132211..b60fdc74b81 100644 --- a/gcc/tree.c +++ b/gcc/tree.c @@ -4382,23 +4382,7 @@ get_callee_fndecl (call) that `f' is being called. */ if (TREE_CODE (addr) == ADDR_EXPR && TREE_CODE (TREE_OPERAND (addr, 0)) == FUNCTION_DECL) - { - tree fn = TREE_OPERAND (addr, 0); - - /* 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); - - return fn; - } + return TREE_OPERAND (addr, 0); /* We couldn't figure out what was being called. */ return NULL_TREE; |

