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

[root@cerebro.laendle: INTEGRATE_THRESHOLD patch]



Sorry, the original mail never showed up on the egcs-list (at least not in
my copy ;), so I re-send it. sorry if it's a duplicate.

-----Forwarded message from Marc Lehmann <root@cerebro.laendle>-----

From: Marc Lehmann <root@cerebro.laendle>
To: egcs@cygnus.com
Subject: INTEGRATE_THRESHOLD patch


Here's the revised version, doing it in the architecture independent part.

Now we can argue about the 1 + 1.5 * nargs formula ;)

1998-02-02  Marc Lehmann  <pcg@goof.com>

	* integrate.c (INTEGRATE_THRESHOLD): Inline only small functions
	when -Os is specified.
	* toplev.c (main): Don't disable flag_inline_functions anymore when
	-Os is in effect.
	
Index: egcs/gcc/integrate.c
===================================================================
RCS file: /home/cvsroot/egcs/gcc/integrate.c,v
retrieving revision 1.1.1.9
diff -u -p -u -p -r1.1.1.9 integrate.c
--- integrate.c	1998/01/23 21:43:57	1.1.1.9
+++ integrate.c	1998/02/02 04:01:29
@@ -52,8 +52,12 @@ extern tree poplevel ();
 /* Default max number of insns a function can have and still be inline.
    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.  */
 #define INTEGRATE_THRESHOLD(DECL) \
-  (8 * (8 + list_length (DECL_ARGUMENTS (DECL))))
+  (optimize_size \
+   ? (1 + (3 * list_length (DECL_ARGUMENTS (DECL)) / 2)) \
+   : (8 * (8 + list_length (DECL_ARGUMENTS (DECL)))))
 #endif
 
 static rtx initialize_for_inline PROTO((tree, int, int, int, int));
Index: egcs/gcc/toplev.c
===================================================================
RCS file: /home/cvsroot/egcs/gcc/toplev.c,v
retrieving revision 1.1.1.13
diff -u -p -u -p -r1.1.1.13 toplev.c
--- toplev.c	1998/01/30 21:56:19	1.1.1.13
+++ toplev.c	1998/02/02 03:57:15
@@ -3797,12 +3797,6 @@ main (argc, argv, envp)
       flag_inline_functions = 1;
     }
 
-  /* Disable code bloating optimizations if optimizing for size. */
-  if (optimize_size)
-    {
-      flag_inline_functions = 0;
-    }
-
   /* Initialize target_flags before OPTIMIZATION_OPTIONS so the latter can
      modify it.  */
   target_flags = 0;
	

-----End of forwarded message-----

  ---------------------------------------------------------------------

    for a pentium-optimizing compiler, look at http://www.gcc.ml.org/

      -----==-                                              |
      ----==-- _                                            |
      ---==---(_)__  __ ____  __       Marc Lehmann       +--
      --==---/ / _ \/ // /\ \/ /       pcg@goof.com       |e|
      -=====/_/_//_/\_,_/ /_/\_\                          --+
    The choice of a GNU generation                        |
                                                          |


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