aboutsummaryrefslogtreecommitdiff
path: root/gcc/ipa-inline-transform.c
diff options
context:
space:
mode:
authorJan Hubicka <hubicka@ucw.cz>2016-05-16 12:10:28 +0200
committerJan Hubicka <hubicka@gcc.gnu.org>2016-05-16 10:10:28 +0000
commit0b9004ed5642ab56f97347cc9c5ca9a59a2fb6bb (patch)
tree2fad4cf8e62a6fa8390658fc1bb6621e961d826e /gcc/ipa-inline-transform.c
parentc1d854fb24ba20ecdd1736117a5e5cd39686e479 (diff)
downloadgcc-0b9004ed5642ab56f97347cc9c5ca9a59a2fb6bb.zip
gcc-0b9004ed5642ab56f97347cc9c5ca9a59a2fb6bb.tar.gz
gcc-0b9004ed5642ab56f97347cc9c5ca9a59a2fb6bb.tar.bz2
ipa-inline-analysis.c (compute_inline_parameters): Be more reailistic on estimating thunk bodies...
* 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. From-SVN: r236274
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 759617b..1e6e108 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;
}