This is the mail archive of the gcc-patches@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]

Re: Web page about inlining


On Wed, Aug 29, 2001 at 01:40:17PM +0200, Gerald Pfeifer wrote:
> On Wed, 29 Aug 2001, Kurt Garloff wrote:
> > http://www.garloff.de/kurt/freesoft/gcc/
> 
> Excellent.  I hope that one of our C++ or global-write maintainers will
> have a look real-soon-now, after all, the first patch (which we can use
> without copyright assignment) is just *three* lines!
> 
> Perhaps you could repost that patch to gcc-patches and also include a
> ChangeLog entry?

OK, I include the ChangeLog and call this patch v1.5 subsequently.
(I also put it on the page).

Folks, please apply it until the Copyright Assigbnment reaches you, at which
point I'd like to ask to get v2.5 (That's v2 with the docu change correctly
done in the .texi file and not in .info), or hopefully a slightly better
tuned v3 included.

Patch attached.

Regards,
-- 
Kurt Garloff                   <kurt@garloff.de>         [Eindhoven, NL]
Physics: Plasma simulations  <K.Garloff@Phys.TUE.NL>  [TU Eindhoven, NL]
Linux: SCSI, Security          <garloff@suse.de>    [SuSE Nuernberg, DE]
 (See mail header or public key servers for PGP2 and GPG public keys.)
--- gcc/cp/optimize.c.orig	Thu Jun  7 00:50:22 2001
+++ gcc/cp/optimize.c	Wed Aug 22 14:01:16 2001
@@ -641,7 +641,7 @@
   else if (varargs_function_p (fn))
     ;
   /* We can't inline functions that are too big.  */
-  else if (DECL_NUM_STMTS (fn) * INSNS_PER_STMT > MAX_INLINE_INSNS)
+  else if (DECL_NUM_STMTS (fn) * INSNS_PER_STMT > MAX_INLINE_INSNS / 2)
     ;
   /* All is well.  We can inline this function.  Traditionally, GCC
      has refused to inline functions using alloca, or functions whose
@@ -657,7 +657,8 @@
      be that we've done so much inlining already that we don't want to
      risk inlining any more.  */
   if ((DECL_NUM_STMTS (fn) + id->inlined_stmts) * INSNS_PER_STMT 
-      > MAX_INLINE_INSNS)
+      > MAX_INLINE_INSNS
+      && DECL_NUM_STMTS (fn) * INSNS_PER_STMT > MAX_INLINE_INSNS / 4)
     inlinable = 0;
 
   /* We can inline a template instantiation only if it's fully
--- gcc/cp/ChangeLog.orig	Mon Aug 20 20:48:06 2001
+++ gcc/cp/ChangeLog	Wed Aug 29 14:15:55 2001
@@ -1,3 +1,10 @@
+2001-08-22  Kurt Garloff  <garloff@suse.de>
+
+	* optimize.c (inlinable_function_p): Change heuristics of inlining:
+	Rather than allow one single function to exhaust the limit,
+	allow only half way. Afterwards don't cut abruptly, but half
+	the allowable size.
+
 2001-08-19  Release Manager
 
 	* GCC 3.0.1 Released.

PGP signature


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