Commit af961c7f by Richard Guenther Committed by Richard Biener

ipa.c (cgraph_postorder): Adjust postorder to guarantee single-iteration always-inline inlining.

2010-04-12  Richard Guenther  <rguenther@suse.de>

	* ipa.c (cgraph_postorder): Adjust postorder to guarantee
	single-iteration always-inline inlining.
	* ipa-inline.c (cgraph_mark_inline): Do not return anything.
	(cgraph_decide_inlining): Do not handle always-inline
	specially.
	(try_inline): Remove always-inline cycle detection special case.
	Do not recurse on always-inlines.
	(cgraph_early_inlining): Do not iterate if not optimizing.
	(cgraph_gate_early_inlining): remove.
	(pass_early_inline): Run unconditionally.
	(gate_cgraph_decide_inlining): New function.
	(pass_ipa_inline): Use it.  Do not run the IPA inliner if
	not inlining or optimizing.
	(cgraph_decide_inlining_of_small_functions): Also consider
	always-inline functions.
	(cgraph_default_inline_p): Return true for nodes which should
	disregard inline limits.
	(estimate_function_body_sizes): Assume zero size and time for
	nodes which are marked as disregarding inline limits.
	(cgraph_decide_recursive_inlining): Do not perform recursive
	inlining on always-inline nodes.

	* gcc.dg/torture/inline-2.c: New testcase.

From-SVN: r158225
parent fa8351f8
2010-04-12 Richard Guenther <rguenther@suse.de>
* ipa.c (cgraph_postorder): Adjust postorder to guarantee
single-iteration always-inline inlining.
* ipa-inline.c (cgraph_mark_inline): Do not return anything.
(cgraph_decide_inlining): Do not handle always-inline
specially.
(try_inline): Remove always-inline cycle detection special case.
Do not recurse on always-inlines.
(cgraph_early_inlining): Do not iterate if not optimizing.
(cgraph_gate_early_inlining): remove.
(pass_early_inline): Run unconditionally.
(gate_cgraph_decide_inlining): New function.
(pass_ipa_inline): Use it. Do not run the IPA inliner if
not inlining or optimizing.
(cgraph_decide_inlining_of_small_functions): Also consider
always-inline functions.
(cgraph_default_inline_p): Return true for nodes which should
disregard inline limits.
(estimate_function_body_sizes): Assume zero size and time for
nodes which are marked as disregarding inline limits.
(cgraph_decide_recursive_inlining): Do not perform recursive
inlining on always-inline nodes.
2010-04-12 Jakub Jelinek <jakub@redhat.com>
PR bootstrap/43699
......
......@@ -70,6 +70,12 @@ cgraph_postorder (struct cgraph_node **order)
node2->aux = edge->next_caller;
else
node2->aux = &last;
/* Break possible cycles involving always-inline
functions by ignoring edges from always-inline
functions to non-always-inline functions. */
if (edge->caller->local.disregard_inline_limits
&& !edge->callee->local.disregard_inline_limits)
continue;
if (!edge->caller->aux)
{
if (!edge->caller->callers)
......
2010-04-12 Richard Guenther <rguenther@suse.de>
* gcc.dg/torture/inline-2.c: New testcase.
2010-04-12 Jakub Jelinek <jakub@redhat.com>
PR bootstrap/43699
......
/* { dg-do link } */
extern inline void foo2 (void) __attribute__((always_inline,gnu_inline));
extern inline void foo1 (void) __attribute__((always_inline,gnu_inline));
void bar1 (void);
void bar2 (void);
extern inline void __attribute__((always_inline,gnu_inline))
foo2 (void)
{
bar2 ();
}
void
bar1 (void)
{
foo2 ();
}
void
bar2 (void)
{
foo1 ();
}
extern inline void __attribute__((always_inline,gnu_inline))
foo1 (void)
{
bar1 ();
}
int main()
{
return 0;
}
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