Commit 264b47b0 by Eric Botcazou Committed by Eric Botcazou

ipa-inline.c (can_inline_edge_p): Look into DECL_STRUCT_FUNCTION of original nodes if...

	* ipa-inline.c (can_inline_edge_p): Look into DECL_STRUCT_FUNCTION of
	original nodes if we are dealing with virtual clones.

From-SVN: r176739
parent 3d02ae65
2011-07-25 Eric Botcazou <ebotcazou@adacore.com>
* ipa-inline.c (can_inline_edge_p): Look into DECL_STRUCT_FUNCTION of
original nodes if we are dealing with virtual clones.
2011-07-25 Bernd Schmidt <bernds@codesourcery.com> 2011-07-25 Bernd Schmidt <bernds@codesourcery.com>
* common/config/c6x/c6x-common.c: New file. * common/config/c6x/c6x-common.c: New file.
......
...@@ -238,9 +238,20 @@ can_inline_edge_p (struct cgraph_edge *e, bool report) ...@@ -238,9 +238,20 @@ can_inline_edge_p (struct cgraph_edge *e, bool report)
{ {
bool inlinable = true; bool inlinable = true;
enum availability avail; enum availability avail;
struct cgraph_node *callee = cgraph_function_or_thunk_node (e->callee, &avail); struct cgraph_node *callee
= cgraph_function_or_thunk_node (e->callee, &avail);
tree caller_tree = DECL_FUNCTION_SPECIFIC_OPTIMIZATION (e->caller->decl); tree caller_tree = DECL_FUNCTION_SPECIFIC_OPTIMIZATION (e->caller->decl);
tree callee_tree = callee ? DECL_FUNCTION_SPECIFIC_OPTIMIZATION (callee->decl) : NULL; tree callee_tree
= callee ? DECL_FUNCTION_SPECIFIC_OPTIMIZATION (callee->decl) : NULL;
struct function *caller_cfun = DECL_STRUCT_FUNCTION (e->caller->decl);
struct function *callee_cfun
= callee ? DECL_STRUCT_FUNCTION (callee->decl) : NULL;
if (!caller_cfun && e->caller->clone_of)
caller_cfun = DECL_STRUCT_FUNCTION (e->caller->clone_of->decl);
if (!callee_cfun && callee && callee->clone_of)
callee_cfun = DECL_STRUCT_FUNCTION (callee->clone_of->decl);
gcc_assert (e->inline_failed); gcc_assert (e->inline_failed);
...@@ -277,12 +288,8 @@ can_inline_edge_p (struct cgraph_edge *e, bool report) ...@@ -277,12 +288,8 @@ can_inline_edge_p (struct cgraph_edge *e, bool report)
caller cannot. caller cannot.
FIXME: this is obviously wrong for LTO where STRUCT_FUNCTION is missing. FIXME: this is obviously wrong for LTO where STRUCT_FUNCTION is missing.
Move the flag into cgraph node or mirror it in the inline summary. */ Move the flag into cgraph node or mirror it in the inline summary. */
else if (DECL_STRUCT_FUNCTION (callee->decl) else if (callee_cfun && callee_cfun->can_throw_non_call_exceptions
&& DECL_STRUCT_FUNCTION && !(caller_cfun && caller_cfun->can_throw_non_call_exceptions))
(callee->decl)->can_throw_non_call_exceptions
&& !(DECL_STRUCT_FUNCTION (e->caller->decl)
&& DECL_STRUCT_FUNCTION
(e->caller->decl)->can_throw_non_call_exceptions))
{ {
e->inline_failed = CIF_NON_CALL_EXCEPTIONS; e->inline_failed = CIF_NON_CALL_EXCEPTIONS;
inlinable = false; inlinable = false;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment