mirror of git://gcc.gnu.org/git/gcc.git
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
This commit is contained in:
parent
8d34e421a5
commit
b631d45ac3
|
|
@ -26,6 +26,17 @@
|
||||||
make_pass_early_warn_uninitialized): Move from tree-ssa.c
|
make_pass_early_warn_uninitialized): Move from tree-ssa.c
|
||||||
* tree-ssa.h: Adjust prototypes
|
* tree-ssa.h: Adjust prototypes
|
||||||
|
|
||||||
|
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>
|
2013-09-17 Jan Hubicka <jh@suse.cz>
|
||||||
|
|
||||||
PR middle-end/58329
|
PR middle-end/58329
|
||||||
|
|
|
||||||
|
|
@ -37,6 +37,9 @@ DEFCIFCODE(UNSPECIFIED , "")
|
||||||
functions that have not been rejected for inlining yet. */
|
functions that have not been rejected for inlining yet. */
|
||||||
DEFCIFCODE(FUNCTION_NOT_CONSIDERED, N_("function not considered for inlining"))
|
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. */
|
/* Inlining failed owing to unavailable function body. */
|
||||||
DEFCIFCODE(BODY_NOT_AVAILABLE, N_("function body not available"))
|
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;
|
info->stack_frame_offset = 0;
|
||||||
|
|
||||||
/* Can this function be inlined at all? */
|
/* 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. */
|
/* Type attributes can use parameter indices to describe them. */
|
||||||
if (TYPE_ATTRIBUTES (TREE_TYPE (node->symbol.decl)))
|
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)
|
if (optimize && !node->thunk.thunk_p)
|
||||||
inline_indirect_intraprocedural_analysis (node);
|
inline_indirect_intraprocedural_analysis (node);
|
||||||
compute_inline_parameters (node, false);
|
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 ();
|
pop_cfun ();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -275,7 +275,8 @@ can_inline_edge_p (struct cgraph_edge *e, bool report,
|
||||||
}
|
}
|
||||||
else if (e->call_stmt_cannot_inline_p)
|
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;
|
inlinable = false;
|
||||||
}
|
}
|
||||||
/* Don't inline if the functions have different EH personalities. */
|
/* Don't inline if the functions have different EH personalities. */
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,8 @@
|
||||||
|
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>
|
2013-09-17 Jeff Law <law@redhat.com>
|
||||||
|
|
||||||
* gcc.c-torture/execute/pr58387.c: New test.
|
* gcc.c-torture/execute/pr58387.c: New test.
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,2 @@
|
||||||
|
static inline int foo (int x) { return x + 1; }
|
||||||
|
__attribute__ ((__optimize__ (0))) int bar (void) { return foo (100); }
|
||||||
Loading…
Reference in New Issue