diff -u gcc-2.95.3.orig/gcc/ChangeLog gcc-2.95.3/gcc/ChangeLog --- gcc-2.95.3.orig/gcc/ChangeLog Fri Mar 16 13:52:02 2001 +++ gcc-2.95.3/gcc/ChangeLog Fri Aug 24 07:57:47 2001 @@ -1,3 +1,11 @@ +2001-08-23 Kurt Garloff + + * integrate.c (function_cannot_inline_p): Reduce max size for + inlining from 10000 to 2000, double this value (i.e. 4000) for + leaf functions. Fine tune INTEGRATE_THRESHOLD for -Os. + * toplev.c (rest_of_compilation): Set current_function_is_leaf + for function_cannot_inline_p + Fri Mar 16 12:46:19 GMT 2001 Bernd Schmidt (bernds@redhat.com) * gcc-2.95.3 Released. Only in gcc-2.95.3/gcc: ChangeLog~ diff -u gcc-2.95.3.orig/gcc/integrate.c gcc-2.95.3/gcc/integrate.c --- gcc-2.95.3.orig/gcc/integrate.c Mon Apr 26 01:35:12 1999 +++ gcc-2.95.3/gcc/integrate.c Fri Aug 24 07:51:35 2001 @@ -53,11 +53,11 @@ This is overridden on RISC machines. */ #ifndef INTEGRATE_THRESHOLD /* Inlining small functions might save more space then not inlining at - all. Assume 1 instruction for the call and 1.5 insns per argument. */ + all. Assume 3 instructions for the call/ret and 4 insns per argument. */ #define INTEGRATE_THRESHOLD(DECL) \ (optimize_size \ - ? (1 + (3 * list_length (DECL_ARGUMENTS (DECL))) / 2) \ - : (8 * (8 + list_length (DECL_ARGUMENTS (DECL))))) + ? ( 3 + ( 4 * list_length (DECL_ARGUMENTS (DECL)))) \ + : (64 + ( 8 * list_length (DECL_ARGUMENTS (DECL))))) #endif static rtx initialize_for_inline PROTO((tree, int, int, int, int)); @@ -91,10 +91,12 @@ function. Increasing values mean more agressive inlining. This affects currently only functions explicitly marked as inline (or methods defined within the class definition for C++). - The default value of 10000 is arbitrary but high to match the - previously unlimited gcc capabilities. */ + The default value of 2000 is much lower than before and + matches a bit better with the 3.0.1 numbers. + We allow double the size for leaf functions. + */ -int inline_max_insns = 10000; +int inline_max_insns = 2000; /* Returns the Ith entry in the label_map contained in MAP. If the @@ -154,6 +156,10 @@ if (current_function_cannot_inline) return current_function_cannot_inline; + /* Prefer leaf functions */ + if (current_function_is_leaf) + max_insns *= 2; + /* If its not even close, don't even look. */ if (get_max_uid () > 3 * max_insns) return N_("function too large to be inline"); Only in gcc-2.95.3/gcc: integrate.c~ Common subdirectories: gcc-2.95.3.orig/gcc/intl and gcc-2.95.3/gcc/intl diff -u gcc-2.95.3.orig/gcc/invoke.texi gcc-2.95.3/gcc/invoke.texi --- gcc-2.95.3.orig/gcc/invoke.texi Thu Jan 25 15:03:17 2001 +++ gcc-2.95.3/gcc/invoke.texi Fri Aug 24 07:55:49 2001 @@ -2351,11 +2351,15 @@ inline (ie marked with the inline keyword or defined within the class definition in c++). @var{n} is the size of functions that can be inlined in number of pseudo instructions (not counting parameter handling). The default -value of n is 10000. Increasing this value can result in more inlined code at -the cost of compilation time and memory consumption. Decreasing usually makes -the compilation faster and less code will be inlined (which presumably -means slower programs). This option is particularly useful for programs that -use inlining heavily such as those based on recursive templates with c++. +value of n is 2000 . Increasing this value (to e.g. 5000) can result in more +inlined code at the cost of compilation time and memory consumption and will +result in larger excutables. Too much inlining can decrease performance +again because of the limited size of your CPU's instruction cache. +Decreasing (e.g. to 250) usually makes the compilation faster and less code +will be inlined (which presumably means smaller executables but slower +programs). This option is particularly useful for programs that use +inlining heavily such as those based on recursive templates with c++. +Note that functions at the leaf of the call tree get a bonus. @emph{Note:} pseudo instruction represents, in this particular context, an abstract measurement of function's size. In no way, it represents a count Only in gcc-2.95.3/gcc: invoke.texi~ diff -u gcc-2.95.3.orig/gcc/toplev.c gcc-2.95.3/gcc/toplev.c --- gcc-2.95.3.orig/gcc/toplev.c Thu Aug 23 07:51:53 2001 +++ gcc-2.95.3/gcc/toplev.c Thu Aug 23 09:41:44 2001 @@ -3623,6 +3623,7 @@ if (DECL_INLINE (decl) || flag_inline_functions) TIMEVAR (integration_time, { + current_function_is_leaf = leaf_function_p (); lose = function_cannot_inline_p (decl); if (lose || ! optimize) { Only in gcc-2.95.3/gcc: toplev.c~