* integrate.c (INTEGRATE_THRESHOLD): Inline only small functions
authorlaw <law@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 5 Feb 1998 20:49:54 +0000 (20:49 +0000)
committerlaw <law@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 5 Feb 1998 20:49:54 +0000 (20:49 +0000)
        when -Os is specified.
        * toplev.c (main): Don't disable flag_inline_functions anymore when
        -Os is in effect.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@17671 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ChangeLog
gcc/integrate.c
gcc/toplev.c

index e20370c..b349a6c 100644 (file)
@@ -1,3 +1,10 @@
+1998-02-05  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.
+
 Fri Feb  6 00:27:36 1998  J"orn Rennecke <amylaar@cygnus.co.uk>
 
         * regmove.c: Update.
index 28731c0..ec1f8b8 100644 (file)
@@ -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
 \f
 static rtx initialize_for_inline PROTO((tree, int, int, int, int));
index ab45028..af67a11 100644 (file)
@@ -3798,12 +3798,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;