]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
backport: re PR middle-end/38584 (Inline heuristics run even at -O0)
authorRichard Guenther <rguenther@suse.de>
Tue, 20 Apr 2010 14:31:47 +0000 (14:31 +0000)
committerRichard Biener <rguenth@gcc.gnu.org>
Tue, 20 Apr 2010 14:31:47 +0000 (14:31 +0000)
2010-04-20  Richard Guenther  <rguenther@suse.de>

Backport from mainline
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.

From-SVN: r158562

gcc/ChangeLog
gcc/ipa-inline.c

index 84cd0c48519d2512a3ce570c4330a98af8122306..7b9fc734670113f1e6882ec5fe9774f3a5a11672 100644 (file)
@@ -1,3 +1,12 @@
+2010-04-20  Richard Guenther  <rguenther@suse.de>
+
+       Backport from mainline
+       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.
+
 2010-04-20  Richard Guenther  <rguenther@suse.de>
 
        Backport from mainline:
index 2ea5f73cdc92274711d879008e7b330ca43572cb..9a9f5dbbc7e36bf772a0a1da22f65dc83217a8aa 100644 (file)
@@ -1529,10 +1529,15 @@ static unsigned int
 compute_inline_parameters (void)
 {
   struct cgraph_node *node = cgraph_node (current_function_decl);
+  HOST_WIDE_INT self_stack_size;
 
   gcc_assert (!node->global.inlined_to);
-  node->local.estimated_self_stack_size = estimated_stack_frame_size ();
-  node->global.estimated_stack_size = node->local.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;
+  node->local.estimated_self_stack_size = self_stack_size;
+  node->global.estimated_stack_size = self_stack_size;
   node->global.stack_frame_offset = 0;
   node->local.inlinable = tree_inlinable_function_p (current_function_decl);
   node->local.self_insns = estimate_num_insns (current_function_decl,