Commit b631d45a by Jan Hubicka Committed by Jan Hubicka

re PR ipa/58332 (error: inlined_to pointer is set but no predecessors found)


	PR middle-end/58332
	* gcc.c-torture/compile/pr58332.c: New testcase.
	* cif-code.def (FUNCTION_NOT_OPTIMIZED): New CIF code.
	* ipa-inline.c (can_inline_edge_p): Do not downgrade
	FUNCTION_NOT_OPTIMIZED.
	* ipa-inline-analysis.c (compute_inline_parameters): Function
	not optimized is not inlinable unless it is alwaysinline.
	(inline_analyze_function): Force calls in not optimized
	function not inlinable.

From-SVN: r202661
parent 8d34e421
......@@ -28,6 +28,17 @@
2013-09-17 Jan Hubicka <jh@suse.cz>
PR middle-end/58332
* cif-code.def (FUNCTION_NOT_OPTIMIZED): New CIF code.
* ipa-inline.c (can_inline_edge_p): Do not downgrade
FUNCTION_NOT_OPTIMIZED.
* ipa-inline-analysis.c (compute_inline_parameters): Function
not optimized is not inlinable unless it is alwaysinline.
(inline_analyze_function): Force calls in not optimized
function not inlinable.
2013-09-17 Jan Hubicka <jh@suse.cz>
PR middle-end/58329
* ipa-devirt.c (ipa_devirt): Be ready for symtab_nonoverwritable_alias
to return NULL.
......
......@@ -37,6 +37,9 @@ DEFCIFCODE(UNSPECIFIED , "")
functions that have not been rejected for inlining yet. */
DEFCIFCODE(FUNCTION_NOT_CONSIDERED, N_("function not considered for inlining"))
/* Caller is compiled with optimizations disabled. */
DEFCIFCODE(FUNCTION_NOT_OPTIMIZED, N_("caller is not optimized"))
/* Inlining failed owing to unavailable function body. */
DEFCIFCODE(BODY_NOT_AVAILABLE, N_("function body not available"))
......
......@@ -2664,7 +2664,11 @@ compute_inline_parameters (struct cgraph_node *node, bool early)
info->stack_frame_offset = 0;
/* Can this function be inlined at all? */
info->inlinable = tree_inlinable_function_p (node->symbol.decl);
if (!optimize && !lookup_attribute ("always_inline",
DECL_ATTRIBUTES (node->symbol.decl)))
info->inlinable = false;
else
info->inlinable = tree_inlinable_function_p (node->symbol.decl);
/* Type attributes can use parameter indices to describe them. */
if (TYPE_ATTRIBUTES (TREE_TYPE (node->symbol.decl)))
......@@ -3678,6 +3682,22 @@ inline_analyze_function (struct cgraph_node *node)
if (optimize && !node->thunk.thunk_p)
inline_indirect_intraprocedural_analysis (node);
compute_inline_parameters (node, false);
if (!optimize)
{
struct cgraph_edge *e;
for (e = node->callees; e; e = e->next_callee)
{
if (e->inline_failed == CIF_FUNCTION_NOT_CONSIDERED)
e->inline_failed = CIF_FUNCTION_NOT_OPTIMIZED;
e->call_stmt_cannot_inline_p = true;
}
for (e = node->indirect_calls; e; e = e->next_callee)
{
if (e->inline_failed == CIF_FUNCTION_NOT_CONSIDERED)
e->inline_failed = CIF_FUNCTION_NOT_OPTIMIZED;
e->call_stmt_cannot_inline_p = true;
}
}
pop_cfun ();
}
......
......@@ -275,7 +275,8 @@ can_inline_edge_p (struct cgraph_edge *e, bool report,
}
else if (e->call_stmt_cannot_inline_p)
{
e->inline_failed = CIF_MISMATCHED_ARGUMENTS;
if (e->inline_failed != CIF_FUNCTION_NOT_OPTIMIZED)
e->inline_failed = CIF_MISMATCHED_ARGUMENTS;
inlinable = false;
}
/* Don't inline if the functions have different EH personalities. */
......
2013-09-17 Jan Hubicka <jh@suse.cz>
PR middle-end/58332
* gcc.c-torture/compile/pr58332.c: New testcase.
2013-09-17 Jeff Law <law@redhat.com>
* gcc.c-torture/execute/pr58387.c: New test.
......
static inline int foo (int x) { return x + 1; }
__attribute__ ((__optimize__ (0))) int bar (void) { return foo (100); }
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