summaryrefslogtreecommitdiffstats
path: root/gcc/integrate.c
diff options
context:
space:
mode:
authorlaw <law@138bc75d-0d04-0410-961f-82ee72b054a4>1998-02-05 20:49:54 +0000
committerlaw <law@138bc75d-0d04-0410-961f-82ee72b054a4>1998-02-05 20:49:54 +0000
commit1befb6647d39feb59cc296e5091187b7f7442b48 (patch)
treeffb329918bec313fd2e4055bc4b596f65ffa05e5 /gcc/integrate.c
parent9b10fda15276f5f5dad5473370e48129c33b35b5 (diff)
downloadppe42-gcc-1befb6647d39feb59cc296e5091187b7f7442b48.tar.gz
ppe42-gcc-1befb6647d39feb59cc296e5091187b7f7442b48.zip
* 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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@17671 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/integrate.c')
-rw-r--r--gcc/integrate.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/gcc/integrate.c b/gcc/integrate.c
index 28731c0060d..ec1f8b81a3a 100644
--- a/gcc/integrate.c
+++ b/gcc/integrate.c
@@ -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));
OpenPOWER on IntegriCloud