OSDN Git Service

* doc/options.texi (Variable): Document.
authorjsm28 <jsm28@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 17 Sep 2010 14:14:49 +0000 (14:14 +0000)
committerjsm28 <jsm28@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 17 Sep 2010 14:14:49 +0000 (14:14 +0000)
* optc-gen.awk, opth-gen.awk: Handle Variable records.  Don't
generate target_flags declarations explicitly.  Don't define
VarExists variables for the driver.
* common.opt (target_flags): New Variable record.
(flag_dump_unnumbered, flag_dump_unnumbered_links,
flag_var_tracking, flag_var_tracking_assignments,
flag_var_tracking_assignments_toggle): Don't mark variables with
VarExists.
* config/i386/i386.c (ix86_isa_flags): Don't define here.
* config/i386/i386.opt (ix86_isa_flags): Define here.
* config/mcore/mcore.c (mcore_stack_increment): Don't define here.
* config/mcore/mcore.opt (mcore_stack_increment): Don't mark with
VarExists.
* flags.h (flag_dump_unnumbered, flag_var_tracking): Remove.
* print-rtl.c (flag_dump_unnumbered, flag_dump_unnumbered_links):
Only define for generator programs.
* rtlanal.c (target_flags): Remove.
* toplev.c (flag_var_tracking, flag_var_tracking_assignments,
flag_var_tracking_assignments_toggle): Remove.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@164370 138bc75d-0d04-0410-961f-82ee72b054a4

13 files changed:
gcc/ChangeLog
gcc/common.opt
gcc/config/i386/i386.c
gcc/config/i386/i386.opt
gcc/config/mcore/mcore.c
gcc/config/mcore/mcore.opt
gcc/doc/options.texi
gcc/flags.h
gcc/optc-gen.awk
gcc/opth-gen.awk
gcc/print-rtl.c
gcc/rtlanal.c
gcc/toplev.c

index dd29405..c36b4f0 100644 (file)
@@ -1,3 +1,26 @@
+2010-09-17  Joseph Myers  <joseph@codesourcery.com>
+
+       * doc/options.texi (Variable): Document.
+       * optc-gen.awk, opth-gen.awk: Handle Variable records.  Don't
+       generate target_flags declarations explicitly.  Don't define
+       VarExists variables for the driver.
+       * common.opt (target_flags): New Variable record.
+       (flag_dump_unnumbered, flag_dump_unnumbered_links,
+       flag_var_tracking, flag_var_tracking_assignments,
+       flag_var_tracking_assignments_toggle): Don't mark variables with
+       VarExists.
+       * config/i386/i386.c (ix86_isa_flags): Don't define here.
+       * config/i386/i386.opt (ix86_isa_flags): Define here.
+       * config/mcore/mcore.c (mcore_stack_increment): Don't define here.
+       * config/mcore/mcore.opt (mcore_stack_increment): Don't mark with
+       VarExists.
+       * flags.h (flag_dump_unnumbered, flag_var_tracking): Remove.
+       * print-rtl.c (flag_dump_unnumbered, flag_dump_unnumbered_links):
+       Only define for generator programs.
+       * rtlanal.c (target_flags): Remove.
+       * toplev.c (flag_var_tracking, flag_var_tracking_assignments,
+       flag_var_tracking_assignments_toggle): Remove.
+
 2010-09-17  Michael Matz  <matz@suse.de>
 
        PR tree-optimization/43432
index 3093ea5..9d653f6 100644 (file)
@@ -23,6 +23,9 @@
 
 ; Please try to keep this file in ASCII collating order.
 
+Variable
+int target_flags
+
 ###
 Driver
 
@@ -552,11 +555,11 @@ Common Report Var(flag_dump_noaddr)
 Suppress output of addresses in debugging dumps
 
 fdump-unnumbered
-Common Report Var(flag_dump_unnumbered) VarExists
+Common Report Var(flag_dump_unnumbered)
 Suppress output of instruction numbers, line number notes and addresses in debugging dumps
 
 fdump-unnumbered-links
-Common Report Var(flag_dump_unnumbered_links) VarExists
+Common Report Var(flag_dump_unnumbered_links)
 Suppress output of previous and next insn numbers in debugging dumps
 
 fdwarf2-cfi-asm
@@ -1511,16 +1514,27 @@ Just generate unwind tables for exception handling
 fuse-linker-plugin
 Common Undocumented
 
+; Positive if we should track variables, negative if we should run
+; the var-tracking pass only to discard debug annotations, zero if
+; we're not to run it.  When flag_var_tracking == 2 (AUTODETECT_VALUE) it
+; will be set according to optimize, debug_info_level and debug_hooks
+; in process_options ().
 fvar-tracking
-Common Report Var(flag_var_tracking) VarExists Optimization
+Common Report Var(flag_var_tracking) Init(2) Optimization
 Perform variable tracking
 
+; Positive if we should track variables at assignments, negative if
+; we should run the var-tracking pass only to discard debug
+; annotations.  When flag_var_tracking_assignments ==
+; AUTODETECT_VALUE it will be set according to flag_var_tracking.
 fvar-tracking-assignments
-Common Report Var(flag_var_tracking_assignments) VarExists Optimization
+Common Report Var(flag_var_tracking_assignments) Init(2) Optimization
 Perform variable tracking by annotating assignments
 
+; Nonzero if we should toggle flag_var_tracking_assignments after
+; processing options and computing its default.  */
 fvar-tracking-assignments-toggle
-Common Report Var(flag_var_tracking_assignments_toggle) VarExists Optimization
+Common Report Var(flag_var_tracking_assignments_toggle) Optimization
 Toggle -fvar-tracking-assignments
 
 fvar-tracking-uninit
index dcf8875..abec057 100644 (file)
@@ -2025,9 +2025,6 @@ static enum calling_abi ix86_function_abi (const_tree);
 static int ix86_tune_defaulted;
 static int ix86_arch_specified;
 
-/* Bit flags that specify the ISA we are compiling for.  */
-int ix86_isa_flags = TARGET_64BIT_DEFAULT | TARGET_SUBTARGET_ISA_DEFAULT;
-
 /* A mask of ix86_isa_flags that includes bit X if X
    was set or cleared on the command line.  */
 static int ix86_isa_flags_explicit;
index aa78cdf..38a53f6 100644 (file)
 ; along with GCC; see the file COPYING3.  If not see
 ; <http://www.gnu.org/licenses/>.
 
+; Bit flags that specify the ISA we are compiling for.
+Variable
+int ix86_isa_flags = TARGET_64BIT_DEFAULT | TARGET_SUBTARGET_ISA_DEFAULT
+
 ;; Definitions to add to the cl_target_option structure
 ;; -march= processor
 TargetSave
index b81a8b9..ce58827 100644 (file)
 #include "target-def.h"
 #include "df.h"
 
-/* Maximum size we are allowed to grow the stack in a single operation.
-   If we want more, we must do it in increments of at most this size.
-   If this value is 0, we don't check at all.  */
-int mcore_stack_increment = STACK_UNITS_MAXSTEP;
-
 /* For dumping information about frame sizes.  */
 char * mcore_current_function_name = 0;
 long   mcore_current_compilation_timestamp = 0;
index c445237..8e465d3 100644 (file)
@@ -63,8 +63,11 @@ mslow-bytes
 Target Report Mask(SLOW_BYTES)
 Prefer word accesses over byte accesses
 
+; Maximum size we are allowed to grow the stack in a single operation.
+; If we want more, we must do it in increments of at most this size.
+; If this value is 0, we don't check at all.
 mstack-increment=
-Target RejectNegative Joined UInteger Var(mcore_stack_increment) VarExists
+Target RejectNegative Joined UInteger Var(mcore_stack_increment) Init(STACK_UNITS_MAXSTEP)
 Set the maximum amount for a single stack increment operation
 
 mwide-bitfields
index c224bbd..924ac17 100644 (file)
@@ -41,6 +41,17 @@ records have two fields: the string @samp{TargetSave}, and a
 declaration type to go in the @code{cl_target_option} structure.
 
 @item
+A variable record to define a variable used to store option
+information.  These records have two fields: the string
+@samp{Variable}, and a declaration of the type and name of the
+variable, optionally with an initializer (but without any trailing
+@samp{;}).  These records may be used for variables used for many
+options where declaring the variable and its initializer by omitting
+@code{VarExists} from a single option definition record would be
+inappropriate, or for variables set in option handlers rather than
+referenced by @code{Var} properties.
+
+@item
 An option definition record.  These records have the following fields:
 @enumerate
 @item
index 93221b4..805308c 100644 (file)
@@ -164,11 +164,6 @@ extern int rtl_dump_and_exit;
 
 extern int flag_gen_aux_info;
 
-/* Nonzero means suppress output of instruction numbers and line number
-   notes in debugging dumps.  */
-
-extern int flag_dump_unnumbered;
-
 /* True if printing into -fdump-final-insns= dump.  */
 
 extern bool final_insns_dump_p;
@@ -301,9 +296,6 @@ enum graph_dump_types
 };
 extern enum graph_dump_types graph_dump_format;
 
-/* Nonzero if we should track variables.  */
-extern int flag_var_tracking;
-
 /* True if flag_speculative_prefetching was set by user.  Used to suppress
    warning message in case flag was set by -fprofile-{generate,use}.  */
 extern bool flag_speculative_prefetching_set;
index bee780c..4a146dd 100644 (file)
@@ -30,6 +30,7 @@ BEGIN {
        n_opts = 0
        n_langs = 0
        n_target_save = 0
+       n_extra_vars = 0
         quote = "\042"
        comma = ","
        FS=SUBSEP
@@ -48,6 +49,10 @@ BEGIN {
                        target_save_decl[n_target_save] = $2
                        n_target_save++
                }
+               else if ($1 == "Variable") {
+                       extra_vars[n_extra_vars] = $2
+                       n_extra_vars++
+               }
                else {
                        name = opt_args("Mask", $1)
                        if (name == "") {
@@ -72,7 +77,6 @@ print "#include " quote "opts.h" quote
 print "#include " quote "intl.h" quote
 print ""
 print "#ifdef GCC_DRIVER"
-print "int target_flags;"
 print "int target_flags_explicit;"
 print "#else"
 print "#include " quote "flags.h" quote
@@ -81,6 +85,9 @@ print "#endif /* GCC_DRIVER */"
 print ""
 
 have_save = 0;
+for (i = 0; i < n_extra_vars; i++) {
+       print extra_vars[i] ";"
+}
 for (i = 0; i < n_opts; i++) {
        if (flag_set_p("Save", flags[i]))
                have_save = 1;
@@ -90,11 +97,7 @@ for (i = 0; i < n_opts; i++) {
                continue;
 
        if (flag_set_p("VarExists", flags[i])) {
-               # Need it for the gcc driver.
-               if (name in var_seen)
-                       continue;
-               init = ""
-               gcc_driver = 1
+               continue;
        }
        else {
                init = opt_args("Init", flags[i])
@@ -102,16 +105,11 @@ for (i = 0; i < n_opts; i++) {
                        init = " = " init;
                else if (name in var_seen)
                        continue;
-               gcc_driver = 0
        }
 
-       if (gcc_driver == 1)
-               print "#ifdef GCC_DRIVER"
        print "/* Set by -" opts[i] "."
        print "   " help[i] "  */"
        print var_type(flags[i]) name init ";"
-       if (gcc_driver == 1)
-               print "#endif /* GCC_DRIVER */"
        print ""
 
        var_seen[name] = 1;
index 0d1d0df..423328d 100644 (file)
@@ -28,6 +28,7 @@ BEGIN {
        n_opts = 0
        n_langs = 0
        n_target_save = 0
+       n_extra_vars = 0
        n_extra_masks = 0
        FS=SUBSEP
 }
@@ -43,6 +44,10 @@ BEGIN {
                        target_save_decl[n_target_save] = $2
                        n_target_save++
                }
+               else if ($1 == "Variable") {
+                       extra_vars[n_extra_vars] = $2
+                       n_extra_vars++
+               }
                else {
                        name = opt_args("Mask", $1)
                        if (name == "") {
@@ -65,12 +70,17 @@ print ""
 print "#ifndef OPTIONS_H"
 print "#define OPTIONS_H"
 print ""
-print "extern int target_flags;"
 print "extern int target_flags_explicit;"
 print ""
 
 have_save = 0;
 
+for (i = 0; i < n_extra_vars; i++) {
+       var = extra_vars[i]
+       sub(" *=.*", "", var)
+       print "extern " var ";"
+}
+
 for (i = 0; i < n_opts; i++) {
        if (flag_set_p("Save", flags[i]))
                have_save = 1;
index 04d7959..ec7e358 100644 (file)
@@ -58,6 +58,10 @@ static void print_rtx (const_rtx);
    the assembly output file.  */
 const char *print_rtx_head = "";
 
+#ifdef GENERATOR_FILE
+/* These are defined from the .opt file when not used in generator
+   programs.  */
+
 /* Nonzero means suppress output of instruction numbers
    in debugging dumps.
    This must be defined here so that programs like gencodes can be linked.  */
@@ -67,6 +71,7 @@ int flag_dump_unnumbered = 0;
    and next insns in debugging dumps.
    This must be defined here so that programs like gencodes can be linked.  */
 int flag_dump_unnumbered_links = 0;
+#endif
 
 /* Nonzero means use simplified format without flags, modes, etc.  */
 int flag_simple = 0;
index 4331f41..d34dc80 100644 (file)
@@ -1,6 +1,6 @@
 /* Analyze RTL for GNU compiler.
    Copyright (C) 1987, 1988, 1992, 1993, 1994, 1995, 1996, 1997, 1998,
-   1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009
+   1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010
    Free Software Foundation, Inc.
 
 This file is part of GCC.
@@ -64,12 +64,6 @@ static unsigned int num_sign_bit_copies1 (const_rtx, enum machine_mode, const_rt
    -1 if a code has no such operand.  */
 static int non_rtx_starting_operands[NUM_RTX_CODE];
 
-/* Bit flags that specify the machine subtype we are compiling for.
-   Bits are tested using macros TARGET_... defined in the tm.h file
-   and set by `-m...' switches.  Must be defined in rtlanal.c.  */
-
-int target_flags;
-
 /* Truncation narrows the mode from SOURCE mode to DESTINATION mode.
    If TARGET_MODE_REP_EXTENDED (DESTINATION, DESTINATION_REP) is
    SIGN_EXTEND then while narrowing we also have to enforce the
index 5995798..e43b6d9 100644 (file)
@@ -291,23 +291,6 @@ int flag_dump_rtl_in_asm = 0;
    the support provided depends on the backend.  */
 rtx stack_limit_rtx;
 
-/* Positive if we should track variables, negative if we should run
-   the var-tracking pass only to discard debug annotations, zero if
-   we're not to run it.  When flag_var_tracking == AUTODETECT_VALUE it
-   will be set according to optimize, debug_info_level and debug_hooks
-   in process_options ().  */
-int flag_var_tracking = AUTODETECT_VALUE;
-
-/* Positive if we should track variables at assignments, negative if
-   we should run the var-tracking pass only to discard debug
-   annotations.  When flag_var_tracking_assignments ==
-   AUTODETECT_VALUE it will be set according to flag_var_tracking.  */
-int flag_var_tracking_assignments = AUTODETECT_VALUE;
-
-/* Nonzero if we should toggle flag_var_tracking_assignments after
-   processing options and computing its default.  */
-int flag_var_tracking_assignments_toggle = 0;
-
 /* Type of stack check.  */
 enum stack_check_type flag_stack_check = NO_STACK_CHECK;