diff options
author | Marc Lehmann <pcg@goof.com> | 1998-02-05 20:49:54 +0000 |
---|---|---|
committer | Jeff Law <law@gcc.gnu.org> | 1998-02-05 13:49:54 -0700 |
commit | aec98e42eff44570e0c88be04e37e297b914534d (patch) | |
tree | ffb329918bec313fd2e4055bc4b596f65ffa05e5 | |
parent | eabb2ebae83d72ceb279b530a631eade3579c836 (diff) | |
download | gcc-aec98e42eff44570e0c88be04e37e297b914534d.zip gcc-aec98e42eff44570e0c88be04e37e297b914534d.tar.gz gcc-aec98e42eff44570e0c88be04e37e297b914534d.tar.bz2 |
integrate.c (INTEGRATE_THRESHOLD): Inline only small functions when -Os is specified.
* 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.
From-SVN: r17671
-rw-r--r-- | gcc/ChangeLog | 7 | ||||
-rw-r--r-- | gcc/integrate.c | 6 | ||||
-rw-r--r-- | gcc/toplev.c | 6 |
3 files changed, 12 insertions, 7 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index e20370c..b349a6c 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -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. diff --git a/gcc/integrate.c b/gcc/integrate.c index 28731c0..ec1f8b8 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)); diff --git a/gcc/toplev.c b/gcc/toplev.c index ab45028..af67a11 100644 --- a/gcc/toplev.c +++ b/gcc/toplev.c @@ -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; |