Maurizio Vitale <maurizio.vitale@xxxxxxxxxxxxxxxxxxxxxx> writes: > In a program that does a lot of template metaprogramming stuff, I > have a function > that I need to be inlined. The resulting code (when inlining happens) > is very short > (about 10-20 instructions), but I have no idea of the complexity of > functions the > compiler is exposed to. > > Now the fun thing: documentation says that the default for -finline- > limit is 600 > and that's the number of ops (in the RTL, I presume). > What happens is that compiling without -finline-limit (gcc 4.1.1) > doesn't inline > my function, but compiling w/ almost any setting (including much > below the default of 600) > does inline succesfully. > Specifically, I have to go down to -finlinel-imit=60 to fail to > inline and -finline-limit=65 > does inline succesfully). > > Now I kind of remember from mailing lists a couple of years ago (but > couldn't find > the threads) that the scale for something (possibly -finline-limit) > was changed > (and the factor of 10 and the number 600 kind of resonate). > > Anybody to comment? > It is possible that the docs are wrong and the default is now 60? The docs are wrong. What they should actually say is more complicated. -finline-limit now controls two different parameters. -finline-limit=N sets both parameters to N / 2. The defaults for the parameters are different (one defaults to 450, the other to 90). So -finline-limit=900 sets one to the default and increases the other, while -finline-limit=180 decreases the first and sets the other to the default. Ian