summaryrefslogtreecommitdiff
path: root/gcc/ipa-inline-transform.c
diff options
context:
space:
mode:
authorhubicka <hubicka@138bc75d-0d04-0410-961f-82ee72b054a4>2016-05-16 10:10:28 +0000
committerhubicka <hubicka@138bc75d-0d04-0410-961f-82ee72b054a4>2016-05-16 10:10:28 +0000
commit46729204a4bd1c5aad4856d9a4f20da54c586241 (patch)
tree2fad4cf8e62a6fa8390658fc1bb6621e961d826e /gcc/ipa-inline-transform.c
parent82da2d0eca8e0001702631abf275cd9ad63f25e0 (diff)
downloadgcc-46729204a4bd1c5aad4856d9a4f20da54c586241.tar.gz
* ipa-inline-analysis.c (compute_inline_parameters): Be more reailistic
on estimating thunk bodies; do not set inline_failed to CIF_THUNK for calls from thunk. * ipa-inline-transform.c (inline_call): When inlining into thunk produce gimple body. (preserve_function_body_p): No need to preserve function body * cif-codes.def (CIF_THUNK): Remove. * cgraphclones.c (duplicate_thunk_for_node): Thunks calls are inlinable. * g++.dg/ipa/ivinline-7.C: Do not xfail. * g++.dg/ipa/ivinline-9.C: Do not xfail. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@236274 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/ipa-inline-transform.c')
-rw-r--r--gcc/ipa-inline-transform.c16
1 files changed, 12 insertions, 4 deletions
diff --git a/gcc/ipa-inline-transform.c b/gcc/ipa-inline-transform.c
index 759617bb72f..1e6e108b9db 100644
--- a/gcc/ipa-inline-transform.c
+++ b/gcc/ipa-inline-transform.c
@@ -314,12 +314,20 @@ inline_call (struct cgraph_edge *e, bool update_original,
/* Don't even think of inlining inline clone. */
gcc_assert (!callee->global.inlined_to);
- e->inline_failed = CIF_OK;
- DECL_POSSIBLY_INLINED (callee->decl) = true;
-
to = e->caller;
if (to->global.inlined_to)
to = to->global.inlined_to;
+ if (to->thunk.thunk_p)
+ {
+ if (in_lto_p)
+ to->get_untransformed_body ();
+ to->expand_thunk (false, true);
+ e = to->callees;
+ }
+
+
+ e->inline_failed = CIF_OK;
+ DECL_POSSIBLY_INLINED (callee->decl) = true;
if (DECL_FUNCTION_PERSONALITY (callee->decl))
DECL_FUNCTION_PERSONALITY (to->decl)
@@ -580,7 +588,7 @@ preserve_function_body_p (struct cgraph_node *node)
gcc_assert (!node->alias && !node->thunk.thunk_p);
/* Look if there is any clone around. */
- if (node->clones)
+ if (node->clones && !node->clones->thunk.thunk_p)
return true;
return false;
}