diff options
| -rw-r--r-- | gcc/ChangeLog | 6 | ||||
| -rw-r--r-- | gcc/ipa-inline.c | 20 |
2 files changed, 22 insertions, 4 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 5c3789a2a82..87d22b44efa 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2008-12-30 Steven Bosscher <steven@gcc.gnu.org> + + PR middle-end/38584 + * ipa-inline.c (compute_inline_parameters): When not optimizing, + don't compute the inline parameters, just set them to 0 instead. + 2008-12-30 Paolo Bonzini <bonzini@gnu.org> PR tree-optimization/38572 diff --git a/gcc/ipa-inline.c b/gcc/ipa-inline.c index 35ec9a60f86..0656d798bc2 100644 --- a/gcc/ipa-inline.c +++ b/gcc/ipa-inline.c @@ -1592,18 +1592,30 @@ struct simple_ipa_opt_pass pass_ipa_early_inline = unsigned int compute_inline_parameters (struct cgraph_node *node) { + HOST_WIDE_INT self_stack_size; + gcc_assert (!node->global.inlined_to); - inline_summary (node)->estimated_self_stack_size - = estimated_stack_frame_size (); - node->global.estimated_stack_size - = inline_summary (node)->estimated_self_stack_size; + + /* Estimate the stack size for the function. But not at -O0 + because estimated_stack_frame_size is a quadratic problem. */ + self_stack_size = optimize ? estimated_stack_frame_size () : 0; + inline_summary (node)->estimated_self_stack_size = self_stack_size; + node->global.estimated_stack_size = self_stack_size; node->global.stack_frame_offset = 0; + + /* Can this function be inlined at all? */ node->local.inlinable = tree_inlinable_function_p (current_function_decl); + + /* Estimate the number of instructions for this function. + ??? At -O0 we don't use this information except for the dumps, and + even then only for always_inline functions. But disabling this + causes ICEs in the inline heuristics... */ inline_summary (node)->self_insns = estimate_num_insns_fn (current_function_decl, &eni_inlining_weights); if (node->local.inlinable && !node->local.disregard_inline_limits) node->local.disregard_inline_limits = DECL_DISREGARD_INLINE_LIMITS (current_function_decl); + /* Inlining characteristics are maintained by the cgraph_mark_inline. */ node->global.insns = inline_summary (node)->self_insns; return 0; |

