This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
MAINLINE PATCH: Make --param Available for gcc (vs. cc1)
- To: gcc-patches at gcc dot gnu dot org
- Subject: MAINLINE PATCH: Make --param Available for gcc (vs. cc1)
- From: Jeffrey Oldham <oldham at codesourcery dot com>
- Date: Wed, 21 Feb 2001 11:46:58 -0800
- Cc: Jeffrey Oldham <oldham at codesourcery dot com>
- Organization: CodeSourcery LLC
Currently Mark Mitchell's "--param <optimization-constant>=<value>"
command-line option is available only for cc1, not gcc. This patch
makes it available to gcc also.
2001-02-21 Jeffrey Oldham <oldham@codesourcery.com>
* gcc.c (cc1_options): Add "-param".
(DEFAULT_WORD_SWITCH_TAKES_ARG): Likewise.
(option_map): Likewise.
* toplev.c (display_help): Add entry for "--param".
(independent_decode_option): Fix typographical error.
Tested on i686-pc-linux-gnu
Approved by Mark Mitchell (mark@codesourcery.com)
Thanks,
Jeffrey D. Oldham
oldham@codesourcery.com
Index: gcc.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/gcc.c,v
retrieving revision 1.207
diff -c -p -r1.207 gcc.c
*** gcc.c 2001/02/19 15:47:29 1.207
--- gcc.c 2001/02/21 19:01:20
*************** static const char *cc1_options =
*** 619,625 ****
%{aux-info*} %{Qn:-fno-ident} %{--help:--help}\
%{--target-help:--target-help}\
%{!fsyntax-only:%{S:%W{o*}%{!o*:-o %b.s}}}\
! %{fsyntax-only:-o %j}";
static const char *asm_options =
"%a %Y %{c:%W{o*}%{!o*:-o %w%b%O}}%{!c:-o %d%w%u%O}";
--- 619,625 ----
%{aux-info*} %{Qn:-fno-ident} %{--help:--help}\
%{--target-help:--target-help}\
%{!fsyntax-only:%{S:%W{o*}%{!o*:-o %b.s}}}\
! %{fsyntax-only:-o %j} %{-param*}";
static const char *asm_options =
"%a %Y %{c:%W{o*}%{!o*:-o %w%b%O}}%{!c:-o %d%w%u%O}";
*************** static struct user_specs *user_specs_hea
*** 674,680 ****
|| !strcmp (STR, "imacros") || !strcmp (STR, "aux-info") \
|| !strcmp (STR, "idirafter") || !strcmp (STR, "iprefix") \
|| !strcmp (STR, "iwithprefix") || !strcmp (STR, "iwithprefixbefore") \
! || !strcmp (STR, "isystem") || !strcmp (STR, "specs") \
|| !strcmp (STR, "MF") || !strcmp (STR, "MT") || !strcmp (STR, "MQ"))
#ifndef WORD_SWITCH_TAKES_ARG
--- 674,681 ----
|| !strcmp (STR, "imacros") || !strcmp (STR, "aux-info") \
|| !strcmp (STR, "idirafter") || !strcmp (STR, "iprefix") \
|| !strcmp (STR, "iwithprefix") || !strcmp (STR, "iwithprefixbefore") \
! || !strcmp (STR, "isystem") || !strcmp (STR, "-param") \
! || !strcmp (STR, "specs") \
|| !strcmp (STR, "MF") || !strcmp (STR, "MT") || !strcmp (STR, "MQ"))
#ifndef WORD_SWITCH_TAKES_ARG
*************** struct option_map option_map[] =
*** 863,868 ****
--- 864,870 ----
{"--optimize", "-O", "oj"},
{"--output", "-o", "a"},
{"--output-class-directory", "-foutput-class-dir=", "ja"},
+ {"--param", "--param", "a"},
{"--pedantic", "-pedantic", 0},
{"--pedantic-errors", "-pedantic-errors", 0},
{"--pipe", "-pipe", 0},
*************** display_help ()
*** 2920,2928 ****
"), stdout);
printf (_("\
! \nOptions starting with -g, -f, -m, -O or -W are automatically passed on to\n\
! the various sub-processes invoked by %s. In order to pass other options\n\
! on to these processes the -W<letter> options must be used.\n\
"), programname);
/* The rest of the options are displayed by invocations of the various
--- 2922,2930 ----
"), stdout);
printf (_("\
! \nOptions starting with -g, -f, -m, -O, -W, or --param are automatically\n\
! passed on to the various sub-processes invoked by %s. In order to pass\n\
! other options on to these processes the -W<letter> options must be used.\n\
"), programname);
/* The rest of the options are displayed by invocations of the various
Index: toplev.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/toplev.c,v
retrieving revision 1.425
diff -c -p -r1.425 toplev.c
*** toplev.c 2001/02/19 00:09:28 1.425
--- toplev.c 2001/02/21 19:01:24
*************** display_help ()
*** 3835,3840 ****
--- 3835,3841 ----
printf (_(" -O[number] Set optimisation level to [number]\n"));
printf (_(" -Os Optimise for space rather than speed\n"));
+ printf (_(" --param <name>=<value> Set constant controlling optimization\n"));
printf (_(" -pedantic Issue warnings needed by strict compliance to ISO C\n"));
printf (_(" -pedantic-errors Like -pedantic except that errors are produced\n"));
printf (_(" -w Suppress warnings\n"));
*************** independent_decode_option (argc, argv)
*** 4386,4392 ****
return 1;
}
! /* Get the '<name>=<value' parameter. */
arg = argv[1];
/* Look for the `='. */
equal = strchr (arg, '=');
--- 4387,4393 ----
return 1;
}
! /* Get the '<name>=<value>' parameter. */
arg = argv[1];
/* Look for the `='. */
equal = strchr (arg, '=');