summaryrefslogtreecommitdiff
path: root/gcc/ipa-inline.c
diff options
context:
space:
mode:
authormmitchel <mmitchel@138bc75d-0d04-0410-961f-82ee72b054a4>2005-12-11 04:16:32 +0000
committermmitchel <mmitchel@138bc75d-0d04-0410-961f-82ee72b054a4>2005-12-11 04:16:32 +0000
commitd9cdeb775555050bc79c86963773d554beaa6805 (patch)
tree550fac8da22e222e4f83bafd10f69af38ff31f7b /gcc/ipa-inline.c
parent4c8420c9b081e5e11b17aad8495674196307bf76 (diff)
downloadgcc-d9cdeb775555050bc79c86963773d554beaa6805.tar.gz
PR c++/25010
* ipa-inline.c (cgraph_clone_inlined_nodes): Do not assume that DECL_EXTERNAL functions have no bodies. Tidy. PR c++/25010 * g++.dg/opt/inline10.C: New test. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@108375 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/ipa-inline.c')
-rw-r--r--gcc/ipa-inline.c36
1 files changed, 19 insertions, 17 deletions
diff --git a/gcc/ipa-inline.c b/gcc/ipa-inline.c
index c16e9475a02..ceadb23261f 100644
--- a/gcc/ipa-inline.c
+++ b/gcc/ipa-inline.c
@@ -115,24 +115,26 @@ cgraph_estimate_size_after_inlining (int times, struct cgraph_node *to,
void
cgraph_clone_inlined_nodes (struct cgraph_edge *e, bool duplicate, bool update_original)
{
- struct cgraph_node *n;
-
- /* We may eliminate the need for out-of-line copy to be output. In that
- case just go ahead and re-use it. */
- if (!e->callee->callers->next_caller
- && (!e->callee->needed || DECL_EXTERNAL (e->callee->decl))
- && duplicate
- && flag_unit_at_a_time)
+ if (duplicate)
{
- gcc_assert (!e->callee->global.inlined_to);
- if (!DECL_EXTERNAL (e->callee->decl))
- overall_insns -= e->callee->global.insns, nfunctions_inlined++;
- duplicate = 0;
- }
- else if (duplicate)
- {
- n = cgraph_clone_node (e->callee, e->count, e->loop_nest, update_original);
- cgraph_redirect_edge_callee (e, n);
+ /* We may eliminate the need for out-of-line copy to be output.
+ In that case just go ahead and re-use it. */
+ if (!e->callee->callers->next_caller
+ && !e->callee->needed
+ && flag_unit_at_a_time)
+ {
+ gcc_assert (!e->callee->global.inlined_to);
+ if (DECL_SAVED_TREE (e->callee->decl))
+ overall_insns -= e->callee->global.insns, nfunctions_inlined++;
+ duplicate = false;
+ }
+ else
+ {
+ struct cgraph_node *n;
+ n = cgraph_clone_node (e->callee, e->count, e->loop_nest,
+ update_original);
+ cgraph_redirect_edge_callee (e, n);
+ }
}
if (e->caller->global.inlined_to)