This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug middle-end/27881] [4.1 Regression] Memory exhausted with -finline-functions on testsuite file alias3.C



------- Comment #3 from rguenth at gcc dot gnu dot org  2006-06-07 13:43 -------
Recursive inlining causes memory usage to grow exponentially.  The current
default limit is

DEFPARAM (PARAM_MAX_INLINE_RECURSIVE_DEPTH_AUTO,
          "max-inline-recursive-depth-auto",
          "The maximum depth of recursive inlining for non-inline functions",
          8, 0, 0)

and for illustration, here's memory growth with changing this parameter:

1    3.2 MiB
2    3.2 MiB
3    5.5 MiB
4    killed after using 495 MiB

we simply create a lot of temporares and calls and basic blocks.  Which some
place of gcc doesn't very much like (t24.fixupcfg dump):

;; Function void A::f(A::X&) (_ZN1A1fERNS_1XE)

Removing basic block 27
Removing basic block 26
Removing basic block 20
Removing basic block 13
Removing basic block 12
Removing basic block 6
Merging blocks 0 and 1
Merging blocks 0 and 2
Merging blocks 0 and 3
Merging blocks 0 and 4
Merging blocks 0 and 5
Merging blocks 0 and 7
Merging blocks 0 and 8
Merging blocks 0 and 9
Merging blocks 0 and 10
Merging blocks 0 and 11
Merging blocks 0 and 14
Merging blocks 0 and 15
Merging blocks 0 and 16
Merging blocks 0 and 17
Merging blocks 0 and 18
Merging blocks 0 and 19
Merging blocks 0 and 21
Merging blocks 0 and 22
Merging blocks 0 and 23
Merging blocks 0 and 24
Merging blocks 0 and 25
Merging blocks 0 and 28
void A::f(A::X&) (x)
{
  struct X & x;
<repeat that line 16382(!!) times>

<bb 0>:
  x = x;
  x = x;
  x = x;
  f (x);
  f (x);
  x = x;
  f (x);
  f (x);
  x = x;
  x = x;
  f (x);
  f (x);
  x = x;
  f (x);
  f (x);
  x = x;
  x = x;
  x = x;
  f (x);
  f (x);
  x = x;
  f (x);
  f (x);
  x = x;
  x = x;
  f (x);
  f (x);
  x = x;
  f (x);
  f (x);
  return;

}


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=27881


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]