------- 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