From e03b71533d939139d9d42da9a3b412e7d3c07e07 Mon Sep 17 00:00:00 2001 From: Roger Sayle Date: Sun, 20 Oct 2002 19:18:30 +0000 Subject: [PATCH] re PR c/761 (Undocumented options, part 1) PR c/761 * toplev.c (flag_unsafe_profile_arcs): Remove. (flag_bounded_pointers): Remove. (flag_bounds_check): Correct comments. (lang_independent_options): Remove -funsafe-profile-arcs and -fbounded-pointers. Correct -fbounds-check comments. * flags.h: Correct flag_schedule_interblock comments. (flag_bounded_pointers): Remove prototype. (flag_bounds_check): Correct comments. * c-opts.c (c_common_init_options): No need to mark flag_bounds_check as unspecified. (c_common_post_options): And no need to set it from flag_bounded_pointers if its still unspecified. * doc/invoke.texi: Fix some overfull hboxes in "make dvi". Document --version, -feliminate-dwarf-2-dups, -fno-sched-interblock, -fno-sched-spec, -fsched-spec-load, -fsched-spec-load-dangerous, -fsched-verbose=n, -fno-branch-count-reg and -fbounds-check. From-SVN: r58334 --- gcc/ChangeLog | 23 ++++++++++++ gcc/c-opts.c | 7 ---- gcc/doc/invoke.texi | 91 ++++++++++++++++++++++++++++++++++++++++----- gcc/flags.h | 15 ++------ gcc/toplev.c | 24 ++---------- 5 files changed, 111 insertions(+), 49 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 871011a429d..6f70514b1e0 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,26 @@ +2002-10-20 Roger Sayle + + PR c/761 + * toplev.c (flag_unsafe_profile_arcs): Remove. + (flag_bounded_pointers): Remove. + (flag_bounds_check): Correct comments. + (lang_independent_options): Remove -funsafe-profile-arcs and + -fbounded-pointers. Correct -fbounds-check comments. + + * flags.h: Correct flag_schedule_interblock comments. + (flag_bounded_pointers): Remove prototype. + (flag_bounds_check): Correct comments. + + * c-opts.c (c_common_init_options): No need to mark + flag_bounds_check as unspecified. + (c_common_post_options): And no need to set it from + flag_bounded_pointers if its still unspecified. + + * doc/invoke.texi: Fix some overfull hboxes in "make dvi". + Document --version, -feliminate-dwarf-2-dups, -fno-sched-interblock, + -fno-sched-spec, -fsched-spec-load, -fsched-spec-load-dangerous, + -fsched-verbose=n, -fno-branch-count-reg and -fbounds-check. + 2002-10-19 Kaveh R. Ghazi Mark Mitchell diff --git a/gcc/c-opts.c b/gcc/c-opts.c index d0e8b8e3c8e..2de8faad4ef 100644 --- a/gcc/c-opts.c +++ b/gcc/c-opts.c @@ -515,9 +515,6 @@ c_common_init_options (lang) warn_pointer_arith = (lang == clk_cplusplus); if (lang == clk_c) warn_sign_compare = -1; - - /* Mark as "unspecified" (see c_common_post_options). */ - flag_bounds_check = -1; } /* Handle one command-line option in (argc, argv). @@ -1374,10 +1371,6 @@ c_common_post_options () } } - /* If still "unspecified", make it match -fbounded-pointers. */ - if (flag_bounds_check == -1) - flag_bounds_check = flag_bounded_pointers; - /* Special format checking options don't work without -Wformat; warn if they are used. */ if (warn_format_y2k && !warn_format) diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi index 22104a29d74..43acaace119 100644 --- a/gcc/doc/invoke.texi +++ b/gcc/doc/invoke.texi @@ -157,7 +157,7 @@ in the following sections. @xref{Overall Options,,Options Controlling the Kind of Output}. @gccoptlist{ -c -S -E -o @var{file} -pipe -pass-exit-codes -x @var{language} @gol --v -### --target-help --help} +-v -### --help --target-help --version} @item C Language Options @xref{C Dialect Options,,Options Controlling C Dialect}. @@ -228,7 +228,8 @@ in the following sections. -Wno-import -Wnonnull -Wpacked -Wpadded @gol -Wparentheses -Wpointer-arith -Wredundant-decls @gol -Wreturn-type -Wsequence-point -Wshadow @gol --Wsign-compare -Wstrict-aliasing -Wswitch -Wswitch-default -Wswitch-enum @gol +-Wsign-compare -Wstrict-aliasing @gol +-Wswitch -Wswitch-default -Wswitch-enum @gol -Wsystem-headers -Wtrigraphs -Wundef -Wuninitialized @gol -Wunknown-pragmas -Wunreachable-code @gol -Wunused -Wunused-function -Wunused-label -Wunused-parameter @gol @@ -236,8 +237,9 @@ in the following sections. @item C-only Warning Options @gccoptlist{ --Wbad-function-cast -Wmissing-declarations -Wmissing-prototypes @gol --Wnested-externs -Wstrict-prototypes -Wtraditional} +-Wbad-function-cast -Wmissing-declarations @gol +-Wmissing-prototypes -Wnested-externs @gol +-Wstrict-prototypes -Wtraditional} @item Debugging Options @xref{Debugging Options,,Options for Debugging Your Program or GCC}. @@ -247,8 +249,9 @@ in the following sections. -fdump-class-hierarchy@r{[}-@var{n}@r{]} @gol -fdump-tree-original@r{[}-@var{n}@r{]} -fdump-tree-optimized@r{[}-@var{n}@r{]} @gol -fdump-tree-inlined@r{[}-@var{n}@r{]} @gol --fmem-report @gol --fprofile-arcs -ftest-coverage -ftime-report @gol +-feliminate-dwarf2-dups -fmem-report @gol +-fprofile-arcs -fsched-verbose=@var{n} @gol +-ftest-coverage -ftime-report @gol -g -g@var{level} -gcoff -gdwarf -gdwarf-1 -gdwarf-1+ -gdwarf-2 @gol -ggdb -gstabs -gstabs+ -gvms -gxcoff -gxcoff+ @gol -p -pg -print-file-name=@var{library} -print-libgcc-file-name @gol @@ -261,6 +264,7 @@ in the following sections. @gccoptlist{ -falign-functions=@var{n} -falign-jumps=@var{n} @gol -falign-labels=@var{n} -falign-loops=@var{n} @gol +-fbounds-check @gol -fbranch-probabilities -fcaller-saves -fcprop-registers @gol -fcse-follow-jumps -fcse-skip-blocks -fdata-sections @gol -fdelayed-branch -fdelete-null-pointer-checks @gol @@ -270,8 +274,8 @@ in the following sections. -fif-conversion -fif-conversion2 @gol -finline-functions -finline-limit=@var{n} -fkeep-inline-functions @gol -fkeep-static-consts -fmerge-constants -fmerge-all-constants @gol --fmove-all-movables -fnew-ra -fno-default-inline @gol --fno-defer-pop @gol +-fmove-all-movables -fnew-ra -fno-branch-count-reg @gol +-fno-default-inline -fno-defer-pop @gol -fno-function-cse -fno-guess-branch-probability @gol -fno-inline -fno-math-errno -fno-peephole -fno-peephole2 @gol -funsafe-math-optimizations -ffinite-math-only @gol @@ -281,7 +285,9 @@ in the following sections. -freduce-all-givs -fregmove -frename-registers @gol -freorder-blocks -freorder-functions @gol -frerun-cse-after-loop -frerun-loop-opt @gol --fschedule-insns -fschedule-insns2 -fsignaling-nans @gol +-fschedule-insns -fschedule-insns2 @gol +-fno-sched-interblock -fno-sched-spec -fsched-spec-load @gol +-fsched-spec-load-dangerous -fsignaling-nans @gol -fsingle-precision-constant -fssa -fssa-ccp -fssa-dce @gol -fstrength-reduce -fstrict-aliasing -ftracer -fthread-jumps @gol -ftrapv -funroll-all-loops -funroll-loops @gol @@ -929,6 +935,10 @@ be displayed. @opindex target-help Print (on the standard output) a description of target specific command line options for each tool. + +@item --version +@opindex version +Display the version number and copyrights of the invoked GCC. @end table @node Invoking G++ @@ -2923,6 +2933,12 @@ and DWARF2, neither @option{-gdwarf} nor @option{-gdwarf-2} accept a concatenated debug level. Instead use an additional @option{-g@var{level}} option to change the debug level for DWARF1 or DWARF2. +@item -feliminate-dwarf2-dups +@opindex feliminate-dwarf2-dups +Compress DWARF2 debugging information by eliminating duplicated +information about each symbol. This option only makes sense when +generating DWARF2 debugging information with @option{-gdwarf-2}. + @cindex @code{prof} @item -p @opindex p @@ -3224,6 +3240,23 @@ Dump after all tree based optimization, to @file{@var{file}.optimized}. Dump after function inlining, to @file{@var{file}.inlined}. @end table +@item -fsched-verbose=@var{n} +@opindex fsched-verbose +On targets that use instruction scheduling, this option controls the +amount of debugging output the scheduler prints. This information is +written to standard error, unless @option{-dS} or @option{-dR} is +specified, in which case it is output to the usual dump +listing file, @file{.sched} or @file{.sched2} respectively. However +for @var{n} greater than nine, the output is always printed to standard +error. + +For @var{n} greater than zero, @option{-fsched-verbose} outputs the +same information as @option{-dRS}. For @var{n} greater than one, it +also output basic block probabilities, detailed ready list information +and unit/insn info. For @var{n} greater than two, it includes RTL +at abort point, control-flow and regions info. And for @var{n} over +four, @option{-fsched-verbose} also includes dependence info. + @item -save-temps @opindex save-temps Store the usual ``temporary'' intermediate files permanently; place them @@ -3527,6 +3560,14 @@ Use a graph coloring register allocator. Currently this option is meant for testing, so we are interested to hear about miscompilations with @option{-fnew-ra}. +@item -fno-branch-count-reg +@opindex fno-branch-count-reg +Do not use ``decrement and branch'' instructions on a count register, +but instead generate a sequence of instructions that decrement a +register, compare it against zero, then branch based upon the result. +This option is only meaningful on architectures that support such +instructions, which include x86, PowerPC, IA-64 and S/390. + @item -fno-function-cse @opindex fno-function-cse Do not put function addresses in registers; make each instruction that @@ -3631,6 +3672,14 @@ resulting executable can find the beginning of that section and/or make assumptions based on that. The default is @option{-fzero-initialized-in-bss}. + +@item -fbounds-check +@opindex fbounds-check +For front-ends that support it, generate additional code to check that +indices used to access arrays are within the declared range. This is +currenly only supported by the Java and Fortran 77 front-ends, where +this option defaults to true and false respectively. + @end table The following options control specific optimizations. The @option{-O2} @@ -3781,6 +3830,30 @@ instruction scheduling after register allocation has been done. This is especially useful on machines with a relatively small number of registers and where memory load instructions take more than one cycle. +@item -fno-sched-interblock +@opindex fno-sched-interblock +Don't schedule instructions across basic blocks. This is normally +enabled by default when scheduling before register allocation, i.e.@: +with @option{-fschedule-insns} or at @option{-O2} or higher. + +@item -fno-sched-spec +@opindex fno-sched-spec +Don't allow speculative motion of non-load instructions. This is normally +enabled by default when scheduling before register allocation, i.e.@: +with @option{-fschedule-insns} or at @option{-O2} or higher. + +@item -fsched-spec-load +@opindex fsched-spec-load +Allow speculative motion of some load instructions. This only makes +sense when scheduling before register allocation, i.e.@: with +@option{-fschedule-insns} or at @option{-O2} or higher. + +@item -fsched-spec-load-dangerous +@opindex fsched-spec-load-dangerous +Allow speculative motion of more load instructions. This only makes +sense when scheduling before register allocation, i.e.@: with +@option{-fschedule-insns} or at @option{-O2} or higher. + @item -ffunction-sections @itemx -fdata-sections @opindex ffunction-sections diff --git a/gcc/flags.h b/gcc/flags.h index c5492759f07..39ca5ea936e 100644 --- a/gcc/flags.h +++ b/gcc/flags.h @@ -431,7 +431,7 @@ extern int flag_schedule_insns_after_reload; /* The following flags have effect only for scheduling before register allocation: - flag_schedule_interblock means schedule insns accross basic blocks. + flag_schedule_interblock means schedule insns across basic blocks. flag_schedule_speculative means allow speculative motion of non-load insns. flag_schedule_speculative_load means allow speculative motion of some load insns. @@ -563,19 +563,10 @@ extern int flag_peephole2; /* Try to guess branch probablities. */ extern int flag_guess_branch_prob; -/* -fbounded-pointers causes gcc to compile pointers as composite - objects occupying three words: the pointer value, the base address - of the referent object, and the address immediately beyond the end - of the referent object. The base and extent allow us to perform - runtime bounds checking. -fbounded-pointers implies -fcheck-bounds. */ -extern int flag_bounded_pointers; - /* -fcheck-bounds causes gcc to generate array bounds checks. - For C, C++: defaults to value of flag_bounded_pointers. - For ObjC: defaults to off. + For C, C++ and ObjC: defaults off. For Java: defaults to on. - For Fortran: defaults to off. - For CHILL: defaults to off. */ + For Fortran: defaults to off. */ extern int flag_bounds_check; /* This will attempt to merge constant section constants, if 1 only diff --git a/gcc/toplev.c b/gcc/toplev.c index 21738982597..815450e0045 100644 --- a/gcc/toplev.c +++ b/gcc/toplev.c @@ -375,11 +375,6 @@ int profile_flag = 0; int profile_arc_flag = 0; -/* Nonzero if we should not attempt to generate thread-safe - code to profile program flow graph arcs. */ - -int flag_unsafe_profile_arcs = 0; - /* Nonzero if generating info for gcov to calculate line test coverage. */ int flag_test_coverage = 0; @@ -863,19 +858,10 @@ int flag_peephole2 = 0; /* This will try to guess branch probabilities. */ int flag_guess_branch_prob = 0; -/* -fbounded-pointers causes gcc to compile pointers as composite - objects occupying three words: the pointer value, the base address - of the referent object, and the address immediately beyond the end - of the referent object. The base and extent allow us to perform - runtime bounds checking. -fbounded-pointers implies -fcheck-bounds. */ -int flag_bounded_pointers = 0; - /* -fcheck-bounds causes gcc to generate array bounds checks. - For C, C++: defaults to value of flag_bounded_pointers. - For ObjC: defaults to off. + For C, C++, ObjC: defaults to off. For Java: defaults to on. - For Fortran: defaults to off. - For CHILL: defaults to off. */ + For Fortran: defaults to off. */ int flag_bounds_check = 0; /* This will attempt to merge constant section constants, if 1 only @@ -1104,8 +1090,6 @@ static const lang_independent_options f_options[] = N_("Support synchronous non-call exceptions") }, {"profile-arcs", &profile_arc_flag, 1, N_("Insert arc based program profiling code") }, - {"unsafe-profile-arcs", &flag_unsafe_profile_arcs, 1, - N_("Avoid thread safety profiling overhead") }, {"test-coverage", &flag_test_coverage, 1, N_("Create data files needed by gcov") }, {"branch-probabilities", &flag_branch_probabilities, 1, @@ -1190,10 +1174,8 @@ static const lang_independent_options f_options[] = N_("Allow math optimizations that may violate IEEE or ANSI standards") }, {"signaling-nans", &flag_signaling_nans, 1, N_("Disable optimizations observable by IEEE signaling NaNs") }, - {"bounded-pointers", &flag_bounded_pointers, 1, - N_("Compile pointers as triples: value, base & end") }, {"bounds-check", &flag_bounds_check, 1, - N_("Generate code to check bounds before dereferencing pointers and arrays") }, + N_("Generate code to check bounds before indexing arrays") }, {"single-precision-constant", &flag_single_precision_constant, 1, N_("Convert floating point constant to single precision constant") }, {"time-report", &time_report, 1, -- 2.30.2