From 06ea1b848618b585bf335d760a18b31f7ad421b1 Mon Sep 17 00:00:00 2001 From: Jan Hubicka Date: Fri, 4 May 2007 17:32:42 +0200 Subject: opts.c (decode_options): Do not fiddle with inlining parameters in case of optimizing for size. * opts.c (decode_options): Do not fiddle with inlining parameters in case of optimizing for size. * ipa-inline.c (cgraph_decide_recursive_inlining): When optimizing for size do nothing. (cgraph_decide_inlining_of_small_function): When optimizing for size never inline functions increasing caller size. (cgraph_early_inlining): Inline for size when optimizing for size. Co-Authored-By: Richard Guenther From-SVN: r124431 --- gcc/ipa-inline.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'gcc/ipa-inline.c') diff --git a/gcc/ipa-inline.c b/gcc/ipa-inline.c index 04306aaa7e0..076979ed5de 100644 --- a/gcc/ipa-inline.c +++ b/gcc/ipa-inline.c @@ -668,6 +668,9 @@ cgraph_decide_recursive_inlining (struct cgraph_node *node) int depth = 0; int n = 0; + if (optimize_size) + return false; + if (DECL_DECLARED_INLINE_P (node->decl)) { limit = PARAM_VALUE (PARAM_MAX_INLINE_INSNS_RECURSIVE); @@ -913,7 +916,7 @@ cgraph_decide_inlining_of_small_functions (void) } } - if (!cgraph_maybe_hot_edge_p (edge) && growth > 0) + if ((!cgraph_maybe_hot_edge_p (edge) || optimize_size) && growth > 0) { if (!cgraph_recursive_inlining_p (edge->caller, edge->callee, &edge->inline_failed)) @@ -1444,7 +1447,7 @@ cgraph_early_inlining (void) if (sorrycount || errorcount) return 0; if (cgraph_decide_inlining_incrementally (node, - flag_unit_at_a_time + flag_unit_at_a_time || optimize_size ? INLINE_SIZE : INLINE_SPEED, 0)) { timevar_push (TV_INTEGRATION); -- cgit v1.2.1