This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

gc 3.[01] Patch: --param Improvements


`--param <name>=<value>' command-line arguments permit specifying
run-time parameters.  Joseph Myers found some mistakes, suggested
applying gcc 3.1 changes of 2001-02-21 to gcc 3.0, and suggested some
improvements.

gcc 3.0:
2001-05-01  Jeffrey Oldham  <oldham@codesourcery.com>

        * ChangeLog (2001-02-21): Remove erroneous entry.
        * gcc.c (cc1_options): Add "-param".
        (DEFAULT_WORD_SWITCH_TAKES_ARG): Likewise.
        (option_map): Likewise.
        (display_help): Add "--param" to 'other' options.
        * invoke.texi (Optimize Options): Add documentation for `--param
        max-delay-slot-insn-search' and `--param
        max-delay-slot-live-search' and reorder --param section.
        * params.def: Modify initial comment.
        * params.h (param_info): Add `help' member.
        * toplev.c (lang_independent_params): Include `help' description.
        (display_help): Print --param parameters.
        (independent_decode_option): Fix typographical error.

gcc 3.1:
2001-05-01  Jeffrey Oldham  <oldham@codesourcery.com>

        * invoke.texi (Optimize Options): Add documentation for `--param
        max-delay-slot-insn-search' and `--param
        max-delay-slot-live-search' and reorder --param section.
        * params.def: Modify initial comment.
        * params.h (param_info): Add `help' member.
        * toplev.c (lang_independent_params): Include `help' description.
        (display_help): Print --param parameters.

Tested on       i686-pc-linux-gnu (bootstrap only)
Approved by     Mark Mitchell (mark@codesourcery.com)

Thanks,
Jeffrey D. Oldham
oldham@codesourcery.com
Index: ChangeLog
===================================================================
RCS file: /cvs/gcc/gcc/gcc/ChangeLog,v
retrieving revision 1.9240.2.298
diff -c -p -r1.9240.2.298 ChangeLog
*** ChangeLog	2001/05/01 14:37:58	1.9240.2.298
--- ChangeLog	2001/05/01 18:54:33
*************** Fri Mar  2 12:18:13 2001  Christopher Fa
*** 1653,1666 ****
  	Move conditional out of loop, simplifying code.
  	(fill_eager_delay_slots): Fix typographical error in comment.
  
- 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.
- 
  2001-02-14  Jeffrey Oldham  <oldham@codesourcery.com>
  
  	* Makefile.in (OBJS): Add params.o.
--- 1653,1658 ----
Index: gcc.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/gcc.c,v
retrieving revision 1.205.2.9
diff -c -p -r1.205.2.9 gcc.c
*** gcc.c	2001/04/26 04:32:13	1.205.2.9
--- gcc.c	2001/05/01 18:54:37
*************** static const char *cc1_options =
*** 618,624 ****
   %{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}";
--- 618,624 ----
   %{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
*** 673,679 ****
    || !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
--- 673,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, "-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: invoke.texi
===================================================================
RCS file: /cvs/gcc/gcc/gcc/invoke.texi,v
retrieving revision 1.273.2.16
diff -c -p -r1.273.2.16 invoke.texi
*** invoke.texi	2001/04/30 20:50:09	1.273.2.16
--- invoke.texi	2001/05/01 18:54:44
*************** In each case, the @var{value} is a integ
*** 3381,3398 ****
  @var{name} are given in the following table:
  
  @table @gcctabopt
! @item max-inline-insns
! If an function contains more than this many instructions, it
! will not be inlined.  This option is precisely equivalent to
! @samp{-finline-limit}.
  
  @item max-gcse-memory
  The approximate maximum amount of memory that will be allocated in
  order to perform the global common subexpression elimination
  optimization.  If more memory than specified is required, the
  optimization will not be done.
- @end table
  
  @end table
  
  @node Preprocessor Options
--- 3381,3414 ----
  @var{name} are given in the following table:
  
  @table @gcctabopt
! @item max-delay-slot-insn-search
! The maximum number of instructions to consider when looking for an
! instruction to fill a delay slot.  If more than this arbitrary number of
! instructions is searched, the time savings from filling the delay slot
! will be minimal so stop searching.  Increasing values mean more
! aggressive optimization, making the compile time increase with probably
! small improvement in executable run time.
! 
! @item max-delay-slot-live-search
! When trying to fill delay slots, the maximum number of instructions to
! consider when searching for a block with valid live register
! information.  Increasing this arbitrarily chosen value means more
! aggressive optimization, increasing the compile time.  This parameter
! should be removed when the delay slot code is rewritten to maintain the
! control-flow graph.
  
  @item max-gcse-memory
  The approximate maximum amount of memory that will be allocated in
  order to perform the global common subexpression elimination
  optimization.  If more memory than specified is required, the
  optimization will not be done.
  
+ @item max-inline-insns
+ If an function contains more than this many instructions, it
+ will not be inlined.  This option is precisely equivalent to
+ @samp{-finline-limit}.
+ 
+ @end table
  @end table
  
  @node Preprocessor Options
Index: params.def
===================================================================
RCS file: /cvs/gcc/gcc/gcc/params.def,v
retrieving revision 1.3.2.2
diff -c -p -r1.3.2.2 params.def
*** params.def	2001/04/11 18:06:53	1.3.2.2
--- params.def	2001/05/01 18:54:45
*************** Boston, MA 02111-1307, USA.  
*** 31,37 ****
  
       - A help string explaining how the parameter is used.
  
!      - A default value for the parameter.  */
  
  /* The maximum number of instructions accepted for inlining a
     function.  Increasing values mean more agressive inlining.
--- 31,39 ----
  
       - A help string explaining how the parameter is used.
  
!      - A default value for the parameter.
! 
!    Be sure to add an entry to invoke.texi summarizing the parameter.  */
  
  /* The maximum number of instructions accepted for inlining a
     function.  Increasing values mean more agressive inlining.
Index: params.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/params.h,v
retrieving revision 1.3.2.2
diff -c -p -r1.3.2.2 params.h
*** params.h	2001/04/11 18:06:53	1.3.2.2
--- params.h	2001/05/01 18:54:45
*************** typedef struct param_info
*** 48,53 ****
--- 48,55 ----
    const char *option;
    /* The associated value.  */
    int value;
+   /* A short description of the option.  */
+   const char *help;
  } param_info;
  
  /* An array containing the compiler parameters and their current
Index: toplev.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/toplev.c,v
retrieving revision 1.420.2.12
diff -c -p -r1.420.2.12 toplev.c
*** toplev.c	2001/04/19 19:51:15	1.420.2.12
--- toplev.c	2001/05/01 18:54:48
*************** const char *user_label_prefix;
*** 960,969 ****
  
  static const param_info lang_independent_params[] = {
  #define DEFPARAM(ENUM, OPTION, HELP, DEFAULT) \
!   { OPTION, DEFAULT },
  #include "params.def"
  #undef DEFPARAM
!   { NULL, 0 }
  };
  
  /* A default for same.  */
--- 960,969 ----
  
  static const param_info lang_independent_params[] = {
  #define DEFPARAM(ENUM, OPTION, HELP, DEFAULT) \
!   { OPTION, DEFAULT, HELP },
  #include "params.def"
  #undef DEFPARAM
!   { NULL, 0, NULL }
  };
  
  /* A default for same.  */
*************** display_help ()
*** 3813,3818 ****
--- 3813,3829 ----
  
    printf (_("  -O[number]              Set optimisation level to [number]\n"));
    printf (_("  -Os                     Optimise for space rather than speed\n"));
+   for (i = sizeof (compiler_params); i--;)
+     {
+       const char *description = compiler_params[i].help;
+       const int length = 21-strlen(compiler_params[i].option);
+ 
+       if (description != NULL && * description != 0)
+ 	printf ("  --param %s=<value>%.*s%s\n",
+ 		compiler_params[i].option,
+ 		length > 0 ? length : 1, "                     ",
+ 		description);
+     }
    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)
*** 4364,4370 ****
          return 1;
        }
  
!       /* Get the '<name>=<value' parameter.  */
        arg = argv[1];
        /* Look for the `='.  */
        equal = strchr (arg, '=');
--- 4375,4381 ----
          return 1;
        }
  
!       /* Get the '<name>=<value>' parameter.  */
        arg = argv[1];
        /* Look for the `='.  */
        equal = strchr (arg, '=');
Index: invoke.texi
===================================================================
RCS file: /cvs/gcc/gcc/gcc/invoke.texi,v
retrieving revision 1.295
diff -c -p -r1.295 invoke.texi
*** invoke.texi	2001/04/28 11:35:03	1.295
--- invoke.texi	2001/05/01 15:11:04
*************** In each case, the @var{value} is a integ
*** 3374,3391 ****
  @var{name} are given in the following table:
  
  @table @gcctabopt
! @item max-inline-insns
! If an function contains more than this many instructions, it
! will not be inlined.  This option is precisely equivalent to
! @samp{-finline-limit}.
  
  @item max-gcse-memory
  The approximate maximum amount of memory that will be allocated in
  order to perform the global common subexpression elimination
  optimization.  If more memory than specified is required, the
  optimization will not be done.
- @end table
  
  @end table
  
  @node Preprocessor Options
--- 3374,3407 ----
  @var{name} are given in the following table:
  
  @table @gcctabopt
! @item max-delay-slot-insn-search
! The maximum number of instructions to consider when looking for an
! instruction to fill a delay slot.  If more than this arbitrary number of
! instructions is searched, the time savings from filling the delay slot
! will be minimal so stop searching.  Increasing values mean more
! aggressive optimization, making the compile time increase with probably
! small improvement in executable run time.
! 
! @item max-delay-slot-live-search
! When trying to fill delay slots, the maximum number of instructions to
! consider when searching for a block with valid live register
! information.  Increasing this arbitrarily chosen value means more
! aggressive optimization, increasing the compile time.  This parameter
! should be removed when the delay slot code is rewritten to maintain the
! control-flow graph.
  
  @item max-gcse-memory
  The approximate maximum amount of memory that will be allocated in
  order to perform the global common subexpression elimination
  optimization.  If more memory than specified is required, the
  optimization will not be done.
  
+ @item max-inline-insns
+ If an function contains more than this many instructions, it
+ will not be inlined.  This option is precisely equivalent to
+ @samp{-finline-limit}.
+ 
+ @end table
  @end table
  
  @node Preprocessor Options
Index: params.def
===================================================================
RCS file: /cvs/gcc/gcc/gcc/params.def,v
retrieving revision 1.4
diff -c -p -r1.4 params.def
*** params.def	2001/04/11 18:22:46	1.4
--- params.def	2001/05/01 15:11:04
*************** Boston, MA 02111-1307, USA.  
*** 31,37 ****
  
       - A help string explaining how the parameter is used.
  
!      - A default value for the parameter.  */
  
  /* The maximum number of instructions accepted for inlining a
     function.  Increasing values mean more agressive inlining.
--- 31,39 ----
  
       - A help string explaining how the parameter is used.
  
!      - A default value for the parameter.
! 
!    Be sure to add an entry to invoke.texi summarizing the parameter.  */
  
  /* The maximum number of instructions accepted for inlining a
     function.  Increasing values mean more agressive inlining.
Index: params.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/params.h,v
retrieving revision 1.4
diff -c -p -r1.4 params.h
*** params.h	2001/04/11 18:22:46	1.4
--- params.h	2001/05/01 15:11:04
*************** typedef struct param_info
*** 48,53 ****
--- 48,55 ----
    const char *option;
    /* The associated value.  */
    int value;
+   /* A short description of the option.  */
+    const char *help;
  } param_info;
  
  /* An array containing the compiler parameters and their current
Index: toplev.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/toplev.c,v
retrieving revision 1.452
diff -c -p -r1.452 toplev.c
*** toplev.c	2001/04/20 03:45:51	1.452
--- toplev.c	2001/05/01 15:11:07
*************** const char *user_label_prefix;
*** 970,979 ****
  
  static const param_info lang_independent_params[] = {
  #define DEFPARAM(ENUM, OPTION, HELP, DEFAULT) \
!   { OPTION, DEFAULT },
  #include "params.def"
  #undef DEFPARAM
!   { NULL, 0 }
  };
  
  /* A default for same.  */
--- 970,979 ----
  
  static const param_info lang_independent_params[] = {
  #define DEFPARAM(ENUM, OPTION, HELP, DEFAULT) \
!   { OPTION, DEFAULT, HELP },
  #include "params.def"
  #undef DEFPARAM
!   { NULL, 0, NULL }
  };
  
  /* A default for same.  */
*************** display_help ()
*** 3843,3849 ****
  
    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"));
--- 3843,3859 ----
  
    printf (_("  -O[number]              Set optimisation level to [number]\n"));
    printf (_("  -Os                     Optimise for space rather than speed\n"));
!   for (i = sizeof (compiler_params); i--;)
!     {
!       const char *description = compiler_params[i].help;
!       const int length = 21-strlen(compiler_params[i].option);
! 
!       if (description != NULL && * description != 0)
! 	printf ("  --param %s=<value>%.*s%s\n",
! 		compiler_params[i].option,
! 		length > 0 ? length : 1, "                     ",
! 		description);
!     }
    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"));

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]