From: law Date: Mon, 26 Jan 1998 23:00:04 +0000 (+0000) Subject: * flags.h: New flag (optimize_size). X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=5736198392201c503b0bd9f8ee86fb8073f19f45;p=platform%2Fupstream%2Flinaro-gcc.git * flags.h: New flag (optimize_size). * toplev.c (main): Parse -Os option and set optimize_space accordingly. * gcc.c (default_compilers), cp/lang-specs.h, f/lang-specs.h: Define __OPTIMIZE_SIZE__ when compiling with -Os. * config/dsp16xx/dsp16xx.h, config/i386/i386.h, config/i386/dgux.h, config/i960/i960.h, config/pdp11/pdp11.h, config/v850/v850.h (OPTIMIZATION_OPTIONS): New SIZE argument to macro. * config/i386/i386.c (optimization_options): Accept new SIZE argument. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@17497 138bc75d-0d04-0410-961f-82ee72b054a4 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 3ec5d67..518c8e5 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,16 @@ +Tue Jan 20 16:01:03 1998 Anthony Green + + * flags.h: New flag (optimize_size). + * toplev.c (main): Parse -Os option and set optimize_space + accordingly. + * gcc.c (default_compilers), cp/lang-specs.h, f/lang-specs.h: Define + __OPTIMIZE_SIZE__ when compiling with -Os. + * config/dsp16xx/dsp16xx.h, config/i386/i386.h, + config/i386/dgux.h, config/i960/i960.h, config/pdp11/pdp11.h, + config/v850/v850.h (OPTIMIZATION_OPTIONS): New SIZE argument + to macro. + * config/i386/i386.c (optimization_options): Accept new SIZE argument. + Mon Jan 26 23:57:39 1998 Manfred Hollstein * libgcc2.c (__clear_insn_cache): On sysV68 enable the memctl diff --git a/gcc/config/dsp16xx/dsp16xx.h b/gcc/config/dsp16xx/dsp16xx.h index e128b48..1386965 100644 --- a/gcc/config/dsp16xx/dsp16xx.h +++ b/gcc/config/dsp16xx/dsp16xx.h @@ -1,5 +1,5 @@ /* Definitions of target machine for GNU compiler. AT&T DSP1600. - Copyright (C) 1994, 1995, 1996, 1997 Free Software Foundation, Inc. + Copyright (C) 1994, 1995, 1996, 1997, 1998 Free Software Foundation, Inc. Contributed by Michael Collison (collison@world.std.com). This file is part of GNU CC. @@ -286,7 +286,7 @@ extern int target_flags; #define OVERRIDE_OPTIONS override_options () -#define OPTIMIZATION_OPTIONS(LEVEL) \ +#define OPTIMIZATION_OPTIONS(LEVEL,SIZE) \ { \ flag_gnu_linker = FALSE; \ \ @@ -298,14 +298,15 @@ extern int target_flags; \ if (LEVEL >= 2) \ { \ - flag_strength_reduce = TRUE; \ + if (! SIZE) \ + flag_strength_reduce = TRUE; \ flag_cse_follow_jumps = TRUE; \ flag_cse_skip_blocks = TRUE; \ flag_expensive_optimizations = TRUE; \ flag_rerun_cse_after_loop = TRUE; \ } \ \ - if (LEVEL >= 3) \ + if ((LEVEL >= 3) && ! SIZE) \ { \ flag_inline_functions = 1; \ } \ diff --git a/gcc/config/i386/dgux.h b/gcc/config/i386/dgux.h index 4a923fc..692fb7d 100644 --- a/gcc/config/i386/dgux.h +++ b/gcc/config/i386/dgux.h @@ -1,5 +1,5 @@ /* Target definitions for GNU compiler for Intel 80x86 running DG/ux - Copyright (C) 1993, 1995, 1996 Free Software Foundation, Inc. + Copyright (C) 1993, 1995, 1996, 1997, 1998 Free Software Foundation, Inc. Currently maintained by gcc@dg-rtp.dg.com. This file is part of GNU CC. @@ -25,7 +25,7 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ #include "i386/sysv4.h" #ifndef VERSION_INFO2 -#define VERSION_INFO2 "$Revision: 1.1 $" +#define VERSION_INFO2 "$Revision: 1.6 $" #endif #ifndef VERSION_STRING @@ -119,12 +119,12 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ */ #undef OPTIMIZATION_OPTIONS -#define OPTIMIZATION_OPTIONS(LEVEL) \ +#define OPTIMIZATION_OPTIONS(LEVEL,SIZE) \ do { \ extern int flag_signed_bitfields; \ flag_signed_bitfields = 0; \ abort_helper (); \ - optimization_options (LEVEL); \ + optimization_options (LEVEL,SIZE); \ } while (0) @@ -170,7 +170,7 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ /* Linker and library spec's. -static, -shared, -symbolic, -h* and -z* access AT&T V.4 link options. -svr4 instructs gcc to place /usr/lib/values-X[cat].o on link the line. - The absense of -msvr4 indicates linking done in a COFF environment and + The absence of -msvr4 indicates linking done in a COFF environment and adds the link script to the link line. In all environments, the first and last objects are crtbegin.o and crtend.o. When the -G link option is used (-shared and -symbolic) a final link is @@ -260,24 +260,6 @@ char insn; int insn_; char * file_; int line_; warning ("argument is a structure"),0 : 0), \ (function_arg (&CUM, MODE, TYPE, NAMED))) -/* This is how to output an assembler line - that says to advance the location counter - to a multiple of 2**LOG bytes. */ - -#undef ASM_OUTPUT_ALIGN -#define ASM_OUTPUT_ALIGN(FILE,LOG) \ - if (LOG <= 2) \ - fprintf ((FILE), "\t.align %d\n", 1<<(LOG));\ - else if ((LOG)!=0) \ - { \ - char buf[256]; \ - if (!backalign_labelno) fprintf ((FILE), "\t.align %d\n", 1); \ - ASM_GENERATE_INTERNAL_LABEL (buf, "LBA", backalign_labelno++); \ - fprintf ((FILE), "%s:", &buf[1]); \ - fprintf ((FILE), "\t.backalign %s,%d,%d\n", &buf[1], 1<<(LOG), \ - ((TARGET_PENTIUMPRO || TARGET_486) && LOG==4) ? 6 : 2);\ - } - -/* add .align 1 to avoid .backalign bug in assembler */ +/* Add .align 1 to avoid .backalign bug in assembler */ #undef CONST_SECTION_ASM_OP #define CONST_SECTION_ASM_OP ".section\t.rodata\n\t.align 1" diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c index a4ec3b6..4e61628 100644 --- a/gcc/config/i386/i386.c +++ b/gcc/config/i386/i386.c @@ -1,5 +1,5 @@ /* Subroutines for insn-output.c for Intel X86. - Copyright (C) 1988, 92, 94, 95, 96, 1997 Free Software Foundation, Inc. + Copyright (C) 1988, 92, 94-97, 1998 Free Software Foundation, Inc. This file is part of GNU CC. @@ -410,8 +410,9 @@ order_regs_for_local_alloc () } void -optimization_options (level) +optimization_options (level, size) int level; + int size; { /* For -O2 and beyond, turn off -fschedule-insns by default. It tends to make the problem with not enough registers even worse. */ diff --git a/gcc/config/i386/i386.h b/gcc/config/i386/i386.h index d2bc5e2..8e48525 100644 --- a/gcc/config/i386/i386.h +++ b/gcc/config/i386/i386.h @@ -1,6 +1,6 @@ /* Definitions of target machine for GNU compiler for Intel X86 (386, 486, Pentium). - Copyright (C) 1988, 92, 94, 95, 96, 1997 Free Software Foundation, Inc. + Copyright (C) 1988, 92, 94-97, 1998 Free Software Foundation, Inc. This file is part of GNU CC. @@ -287,7 +287,7 @@ extern int ix86_arch; #define SUBTARGET_OPTIONS /* Define this to change the optimizations performed by default. */ -#define OPTIMIZATION_OPTIONS(LEVEL) optimization_options(LEVEL) +#define OPTIMIZATION_OPTIONS(LEVEL,SIZE) optimization_options(LEVEL,SIZE) /* Specs for the compiler proper */ diff --git a/gcc/config/i960/i960.h b/gcc/config/i960/i960.h index d9cddb9..1ef3ba7 100644 --- a/gcc/config/i960/i960.h +++ b/gcc/config/i960/i960.h @@ -1,5 +1,5 @@ /* Definitions of target machine for GNU compiler, for Intel 80960 - Copyright (C) 1992, 1993, 1995, 1996 Free Software Foundation, Inc. + Copyright (C) 1992, 1993, 1995, 1996, 1998 Free Software Foundation, Inc. Contributed by Steven McGeady, Intel Corp. Additional Work by Glenn Colon-Bonet, Jonathan Shapiro, Andy Wilson Converted to GCC 2.0 by Jim Wilson and Michael Tiemann, Cygnus Support. @@ -94,7 +94,7 @@ Boston, MA 02111-1307, USA. */ #define CAN_DEBUG_WITHOUT_FP /* Do leaf procedure and tail call optimizations for -O2 and higher. */ -#define OPTIMIZATION_OPTIONS(LEVEL) \ +#define OPTIMIZATION_OPTIONS(LEVEL,SIZE) \ { \ if ((LEVEL) >= 2) \ { \ diff --git a/gcc/config/pdp11/pdp11.h b/gcc/config/pdp11/pdp11.h index 9a37528..87c4954 100644 --- a/gcc/config/pdp11/pdp11.h +++ b/gcc/config/pdp11/pdp11.h @@ -1,5 +1,5 @@ /* Definitions of target machine for GNU compiler, for the pdp-11 - Copyright (C) 1994, 1995, 1996 Free Software Foundation, Inc. + Copyright (C) 1994, 1995, 1996, 1998 Free Software Foundation, Inc. Contributed by Michael K. Gschwind (mike@vlsivie.tuwien.ac.at). This file is part of GNU CC. @@ -1295,11 +1295,12 @@ JMP FUNCTION 0x0058 0x0000 <- FUNCTION LEVEL is the optimization level specified; 2 if -O2 is specified, 1 if -O is specified, and 0 if neither is specified. */ -#define OPTIMIZATION_OPTIONS(LEVEL) \ +#define OPTIMIZATION_OPTIONS(LEVEL,SIZE) \ { \ if (LEVEL >= 3) \ { \ - flag_inline_functions = 1; \ + if (! SIZE) \ + flag_inline_functions = 1; \ flag_omit_frame_pointer = 1; \ /* flag_unroll_loops = 1; */ \ } \ diff --git a/gcc/config/v850/v850.h b/gcc/config/v850/v850.h index b09a475..59ad91d 100644 --- a/gcc/config/v850/v850.h +++ b/gcc/config/v850/v850.h @@ -1,5 +1,5 @@ /* Definitions of target machine for GNU compiler. NEC V850 series - Copyright (C) 1996, 1997 Free Software Foundation, Inc. + Copyright (C) 1996, 1997, 1998 Free Software Foundation, Inc. Contributed by Jeff Law (law@cygnus.com). This file is part of GNU CC. @@ -208,6 +208,8 @@ extern struct small_memory_info small_memory[(int)SMALL_MEMORY_max]; LEVEL is the optimization level specified; 2 if `-O2' is specified, 1 if `-O' is specified, and 0 if neither is specified. + SIZE is non-zero if `-Os' is specified, 0 otherwise. + You should not use this macro to change options that are not machine-specific. These should uniformly selected by the same optimization level on all supported machines. Use this macro to @@ -216,7 +218,7 @@ extern struct small_memory_info small_memory[(int)SMALL_MEMORY_max]; *Do not examine `write_symbols' in this macro!* The debugging options are not supposed to alter the generated code. */ -#define OPTIMIZATION_OPTIONS(LEVEL) \ +#define OPTIMIZATION_OPTIONS(LEVEL,SIZE) \ { \ if (LEVEL) \ target_flags |= (MASK_EP | MASK_PROLOG_FUNCTION); \ diff --git a/gcc/cp/lang-specs.h b/gcc/cp/lang-specs.h index 381bec5..78a6956 100644 --- a/gcc/cp/lang-specs.h +++ b/gcc/cp/lang-specs.h @@ -34,7 +34,7 @@ Boston, MA 02111-1307, USA. */ -undef -D__GNUC__=%v1 -D__GNUG__=%v1 -D__cplusplus -D__GNUC_MINOR__=%v2\ %{ansi:-trigraphs -D__STRICT_ANSI__} %{!undef:%{!ansi:%p} %P}\ %{!fno-exceptions:-D__EXCEPTIONS}\ - %c %{O*:%{!O0:-D__OPTIMIZE__}} %{trigraphs}\ + %c %{Os:-D__OPTIMIZE_SIZE__} %{O*:%{!O0:-D__OPTIMIZE__}} %{trigraphs}\ %{g*} %{W*} %{w} %{pedantic*} %{H} %{d*} %C %{D*} %{U*} %{i*} %Z\ %i %{!M:%{!MM:%{!E:%{!pipe:%g.ii}}}}%{E:%W{o*}}%{M:%W{o*}}%{MM:%W{o*}} |\n", "%{!M:%{!MM:%{!E:cc1plus %{!pipe:%g.ii} %1 %2\ diff --git a/gcc/f/lang-specs.h b/gcc/f/lang-specs.h index 016f59c..a51e2a6 100644 --- a/gcc/f/lang-specs.h +++ b/gcc/f/lang-specs.h @@ -49,7 +49,7 @@ the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA -undef -D__GNUC__=%v1 -D__GNUC_MINOR__=%v2\ %{ansi:-trigraphs -$ -D__STRICT_ANSI__}\ %{!undef:%P} -D_LANGUAGE_FORTRAN %{trigraphs} \ - %c %{O*:%{!O0:-D__OPTIMIZE__}} -traditional\ + %c %{Os:-D__OPTIMIZE_SIZE__} %{O*:%{!O0:-D__OPTIMIZE__}} -traditional\ %{g*} %{W*} %{w} %{pedantic*} %{H} %{d*} %C %{D*} %{U*} %{i*} %Z\ %i %{!M:%{!MM:%{!E:%{!pipe:%g.i}}}}%{E:%W{o*}}%{M:%W{o*}}%{MM:%W{o*}} |\n", "%{!M:%{!MM:%{!E:f771 %{!pipe:%g.i} -fset-g77-defaults %(f771) \ diff --git a/gcc/flags.h b/gcc/flags.h index 616726e..f5d1255 100644 --- a/gcc/flags.h +++ b/gcc/flags.h @@ -1,5 +1,5 @@ /* Compilation switch flag definitions for GNU CC. - Copyright (C) 1987, 88, 94, 95, 96, 1997 Free Software Foundation, Inc. + Copyright (C) 1987, 88, 94-97, 1998 Free Software Foundation, Inc. This file is part of GNU CC. @@ -53,6 +53,10 @@ extern int use_gnu_debug_info_extensions; extern int optimize; +/* Nonzero means optimize for size. -Os. */ + +extern int optimize_size; + /* Nonzero means do stupid register allocation. -noreg. Currently, this is 1 if `optimize' is 0. */ diff --git a/gcc/gcc.c b/gcc/gcc.c index 52a23bb..05e741f 100644 --- a/gcc/gcc.c +++ b/gcc/gcc.c @@ -1,5 +1,5 @@ /* Compiler driver program that can handle many languages. - Copyright (C) 1987, 89, 92-96, 1997 Free Software Foundation, Inc. + Copyright (C) 1987, 89, 92-97, 1998 Free Software Foundation, Inc. This file is part of GNU CC. @@ -601,7 +601,8 @@ static struct compiler default_compilers[] = -undef -D__GNUC__=%v1 -D__GNUC_MINOR__=%v2\ %{ansi:-trigraphs -D__STRICT_ANSI__}\ %{!undef:%{!ansi:%p} %P} %{trigraphs} \ - %c %{O*:%{!O0:-D__OPTIMIZE__}} %{traditional} %{ftraditional:-traditional}\ + %c %{Os:-D__OPTIMIZE_SIZE__} %{O*:%{!O0:-D__OPTIMIZE__}}\ + %{traditional} %{ftraditional:-traditional}\ %{traditional-cpp:-traditional}\ %{g*} %{W*} %{w} %{pedantic*} %{H} %{d*} %C %{D*} %{U*} %{i*} %Z\ %i %{!M:%{!MM:%{!E:%{!pipe:%g.i}}}}%{E:%W{o*}}%{M:%W{o*}}%{MM:%W{o*}} |\n", @@ -622,7 +623,8 @@ static struct compiler default_compilers[] = -undef -D__GNUC__=%v1 -D__GNUC_MINOR__=%v2\ %{ansi:-trigraphs -D__STRICT_ANSI__}\ %{!undef:%{!ansi:%p} %P} %{trigraphs}\ - %c %{O*:%{!O0:-D__OPTIMIZE__}} %{traditional} %{ftraditional:-traditional}\ + %c %{Os:-D__OPTIMIZE_SIZE__} %{O*:%{!O0:-D__OPTIMIZE__}}\ + %{traditional} %{ftraditional:-traditional}\ %{traditional-cpp:-traditional}\ %{g*} %{W*} %{w} %{pedantic*} %{H} %{d*} %C %{D*} %{U*} %{i*} %Z\ %i %W{o*}}\ @@ -635,7 +637,8 @@ static struct compiler default_compilers[] = -undef -D__OBJC__ -D__GNUC__=%v1 -D__GNUC_MINOR__=%v2\ %{ansi:-trigraphs -D__STRICT_ANSI__}\ %{!undef:%{!ansi:%p} %P} %{trigraphs}\ - %c %{O*:%{!O0:-D__OPTIMIZE__}} %{traditional} %{ftraditional:-traditional}\ + %c %{Os:-D__OPTIMIZE_SIZE__} %{O*:%{!O0:-D__OPTIMIZE__}}\ + %{traditional} %{ftraditional:-traditional}\ %{traditional-cpp:-traditional}\ %{g*} %{W*} %{w} %{pedantic*} %{H} %{d*} %C %{D*} %{U*} %{i*} %Z\ %i %{!M:%{!MM:%{!E:%{!pipe:%g.i}}}}%{E:%W{o*}}%{M:%W{o*}}%{MM:%W{o*}} |\n", @@ -659,7 +662,8 @@ static struct compiler default_compilers[] = -undef -D__GNUC__=%v1 -D__GNUC_MINOR__=%v2\ %{ansi:-trigraphs -D__STRICT_ANSI__}\ %{!undef:%{!ansi:%p} %P} %{trigraphs}\ - %c %{O*:%{!O0:-D__OPTIMIZE__}} %{traditional} %{ftraditional:-traditional}\ + %c %{Os:-D__OPTIMIZE_SIZE__} %{O*:%{!O0:-D__OPTIMIZE__}}\ + %{traditional} %{ftraditional:-traditional}\ %{traditional-cpp:-traditional}\ %{g*} %{W*} %{w} %{pedantic*} %{H} %{d*} %C %{D*} %{U*} %{i*} %Z\ %i %W{o*}"}, @@ -685,7 +689,8 @@ static struct compiler default_compilers[] = %{C:%{!E:%eGNU C does not support -C without using -E}}\ %{M} %{MM} %{MD:-MD %b.d} %{MMD:-MMD %b.d} %{MG} %{trigraphs}\ -undef -$ %{!undef:%p %P} -D__ASSEMBLER__ \ - %c %{O*:%{!O0:-D__OPTIMIZE__}} %{traditional} %{ftraditional:-traditional}\ + %c %{Os:-D__OPTIMIZE_SIZE__} %{O*:%{!O0:-D__OPTIMIZE__}}\ + %{traditional} %{ftraditional:-traditional}\ %{traditional-cpp:-traditional}\ %{g*} %{W*} %{w} %{pedantic*} %{H} %{d*} %C %{D*} %{U*} %{i*} %Z\ %i %{!M:%{!MM:%{!E:%{!pipe:%g.s}}}}%{E:%W{o*}}%{M:%W{o*}}%{MM:%W{o*}} |\n", diff --git a/gcc/invoke.texi b/gcc/invoke.texi index ef83383..562eb77 100644 --- a/gcc/invoke.texi +++ b/gcc/invoke.texi @@ -1,4 +1,4 @@ -@c Copyright (C) 1988,89,92,93,94,95,96,1997 Free Software Foundation, Inc. +@c Copyright (C) 1988,89,92-97,1998 Free Software Foundation, Inc. @c This is part of the GCC manual. @c For copying conditions, see the file gcc.texi. @@ -155,7 +155,7 @@ in the following sections. -fschedule-insns2 -fstrength-reduce -fthread-jumps -funroll-all-loops -funroll-loops -fmove-all-movables -freduce-all-givs --O -O0 -O1 -O2 -O3 +-O -O0 -O1 -O2 -O3 -Os @end smallexample @item Preprocessor Options @@ -2078,6 +2078,11 @@ Optimize yet more. @samp{-O3} turns on all optimizations specified by @item -O0 Do not optimize. +@item -Os +Optimize for size. @samp{-Os} enables all @samp{-O2} optimizations that +do not typically increase code size. It also performs further +optimizations designed to reduce code size. + If you use multiple @samp{-O} options, with or without level numbers, the last such option is the one that is effective. @end table diff --git a/gcc/tm.texi b/gcc/tm.texi index a8c2f03..981d0f9 100644 --- a/gcc/tm.texi +++ b/gcc/tm.texi @@ -1,4 +1,4 @@ -@c Copyright (C) 1988,89,92,93,94,96,1997 Free Software Foundation, Inc. +@c Copyright (C) 1988,89,92-97,1998 Free Software Foundation, Inc. @c This is part of the GCC manual. @c For copying conditions, see the file gcc.texi. @@ -591,7 +591,7 @@ Don't use this macro to turn on various extra optimizations for @samp{-O}. That is what @code{OPTIMIZATION_OPTIONS} is for. @findex OPTIMIZATION_OPTIONS -@item OPTIMIZATION_OPTIONS (@var{level}) +@item OPTIMIZATION_OPTIONS (@var{level}, @var{size}) Some machines may desire to change what optimizations are performed for various optimization levels. This macro, if defined, is executed once just after the optimization level is determined and before the remainder @@ -601,6 +601,8 @@ used as the default values for the other command line options. @var{level} is the optimization level specified; 2 if @samp{-O2} is specified, 1 if @samp{-O} is specified, and 0 if neither is specified. +@var{size} is non-zero if @samp{-Os} is specified and zero otherwise. + You should not use this macro to change options that are not machine-specific. These should uniformly selected by the same optimization level on all supported machines. Use this macro to enable diff --git a/gcc/toplev.c b/gcc/toplev.c index 7c9ca60..5d19787 100644 --- a/gcc/toplev.c +++ b/gcc/toplev.c @@ -1,5 +1,5 @@ /* Top level of GNU C compiler - Copyright (C) 1987, 88, 89, 92-6, 1997 Free Software Foundation, Inc. + Copyright (C) 1987, 88, 89, 92-7, 1998 Free Software Foundation, Inc. This file is part of GNU CC. @@ -306,6 +306,13 @@ int use_gnu_debug_info_extensions = 0; int optimize = 0; +/* Nonzero means optimize for size. -Os. + The only valid values are zero and non-zero. When optimize_size is + non-zero, optimize defaults to 2, but certain individual code + bloating optimizations are disabled. */ + +int optimize_size = 0; + /* Number of error messages and warning messages so far. */ int errorcount = 0; @@ -3719,18 +3726,27 @@ main (argc, argv, envp) } else if (argv[i][0] == '-' && argv[i][1] == 'O') { - /* Handle -O2, -O3, -O69, ... */ + /* Handle -Os, -O2, -O3, -O69, ... */ char *p = &argv[i][2]; int c; - - while (c = *p++) - if (! (c >= '0' && c <= '9')) - break; - if (c == 0) - optimize = atoi (&argv[i][2]); + + if ((p[0] == 's') && (p[1] == 0)) + optimize_size = 1; + else + { + while (c = *p++) + if (! (c >= '0' && c <= '9')) + break; + if (c == 0) + optimize = atoi (&argv[i][2]); + } } } + /* Optimizing for size forces optimize to be no less than 2. */ + if (optimize_size && (optimize < 2)) + optimize = 2; + obey_regdecls = (optimize == 0); if (optimize >= 1) @@ -3767,6 +3783,12 @@ 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; @@ -3774,7 +3796,7 @@ main (argc, argv, envp) #ifdef OPTIMIZATION_OPTIONS /* Allow default optimizations to be specified on a per-machine basis. */ - OPTIMIZATION_OPTIONS (optimize); + OPTIMIZATION_OPTIONS (optimize, optimize_size); #endif /* Initialize register usage now so switches may override. */ @@ -3966,8 +3988,11 @@ main (argc, argv, envp) else if (str[0] == 'O') { register char *p = str+1; - while (*p && *p >= '0' && *p <= '9') + if (*p == 's') p++; + else + while (*p && *p >= '0' && *p <= '9') + p++; if (*p == '\0') ; else