This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug middle-end/27881] [4.1 Regression] Memory exhausted with -finline-functions on testsuite file alias3.C
- From: "rguenth at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 14 Nov 2006 17:42:01 -0000
- Subject: [Bug middle-end/27881] [4.1 Regression] Memory exhausted with -finline-functions on testsuite file alias3.C
- References: <bug-27881-8581@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #10 from rguenth at gcc dot gnu dot org 2006-11-14 17:42 -------
It's true that the number of created calls is 2^N, but unfortunately the number
of created temporaries grows super-exponential:
--param max-inline-recursive-depth-auto grep 'struct X' t.C.t24.fixupcfg
| wc -l
1 3
2 63
3 16383 (!)
So it grows like n_i = (2*(n_{i-1}+1))**2 - 1 with n_1 = 3.
For 4 we would have 1073741823, for 5 we get 4611686018427387904 number
of temporaries ;)
Honza's patch (comment #8) fixes this on the mainline, but I guess porting that
back is not really an option. We might instead lower the default value of
max-inline-recursive-depth[-auto], which is currently 8.
>From the above numbers a limit of 2 should be appropriate. Or we can make
it count the number of functions inlined, not the depth, to avoid exponential
behavior with multiple calls to self.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=27881