aboutsummaryrefslogtreecommitdiff
path: root/gcc/optc-gen.awk
AgeCommit message (Collapse)AuthorFilesLines
2019-09-10Rename Deprecated to WarnRemoved in *.opt files.Martin Liska1-4/+6
2019-09-10 Martin Liska <mliska@suse.cz> * common.opt: Use newly added WarnRemoved. * config/aarch64/aarch64.opt: Likewise. * config/arm/arm.opt: Likewise. * config/i386/i386.opt: Likewise. * config/ia64/ia64.opt: Likewise. * config/rs6000/rs6000.opt: Likewise. * doc/options.texi: Document WarnRemoved properly. * dwarf2out.c (gen_producer_string): Handle renamed OPT_SPECIAL_warn_removed. * lto-opts.c (lto_write_options): Likewise. * lto-wrapper.c (merge_and_complain): Likewise. * opts-common.c (decode_cmdline_option): Likewise. (prune_options): Likewise. (read_cmdline_option): Likewise. (control_warning_option): Likewise. * opts.c (print_filtered_help): Likewise. * optc-gen.awk: Parse for WarnRemoved and make usage of Deprecated an error. * opth-gen.awk: Generate new OPT_SPECIAL_warn_removed. 2019-09-10 Martin Liska <mliska@suse.cz> * c.opt: Use newly added WarnRemoved. From-SVN: r275592
2019-01-01Update copyright years.Jakub Jelinek1-1/+1
From-SVN: r267494
2018-09-05Ignore properly -mdirect-move (PR target/87164).Martin Liska1-2/+0
2018-09-05 Martin Liska <mliska@suse.cz> PR target/87164 * config/rs6000/rs6000.opt: Mark the option as Deprecated. * optc-gen.awk: Allow 'Var' for Deprecated options in order to generate a MASK value. From-SVN: r264111
2018-08-17Merge Ignore and Deprecated in .opt files.Martin Liska1-2/+18
2018-08-17 Martin Liska <mliska@suse.cz> * common.opt: Remove Warn, Init and Report for options with Ignore/Deprecated flag. Warning is done automatically for Deprecated flags. * config/i386/i386.opt: Likewise. * config/ia64/ia64.opt: Likewise. * config/rs6000/rs6000.opt: Likewise. * cppbuiltin.c (define_builtin_macros_for_compilation_flags): Remove usage of flag_check_pointer_bounds. * lto-wrapper.c (merge_and_complain): Do not handle OPT_fcheck_pointer_bounds. (append_compiler_options): Likewise. * opt-functions.awk: Do not handle Deprecated. * optc-gen.awk: Check that Var, Report and Init are not used for an option with Ignore/Deprecated flag. * opts-common.c (decode_cmdline_option): Do not report CL_ERR_DEPRECATED. (read_cmdline_option): Report warning for OPT_SPECIAL_deprecated options. * opts.h (struct cl_option): Remove cl_deprecated flag. (CL_ERR_DEPRECATED): Remove error enum value. 2018-08-17 Martin Liska <mliska@suse.cz> * g++.dg/opt/mpx.C: Fix scanned pattern. * gcc.target/i386/mpx.c: Likewise. * g++.dg/warn/Wunreachable-code-1.C: Remove. * g++.dg/warn/Wunreachable-code-2.C: Likewise. * gcc.dg/torture/pr52969.c: Likewise. * g++.dg/warn/pr31246-2.C: Likewise. * g++.dg/warn/pr31246.C: Likewise. * gcc.dg/pr33092.c: Likewise. * g++.dg/opt/eh1.C: Remove a deprecated option. * g++.dg/template/inline1.C: Likewise. * g++.dg/tree-ssa/pr81408.C: Likewise. * gcc.dg/pr41837.c: Likewise. * gcc.dg/pr41841.c: Likewise. * gcc.dg/pr42250.c: Likewise. * gcc.dg/pr43084.c: Likewise. * gcc.dg/pr43317.c: Likewise. * gcc.dg/pr51879-18.c: Likewise. * gcc.dg/torture/pr36066.c: Likewise. * gcc.dg/tree-ssa/ifc-8.c: Likewise. * gcc.dg/tree-ssa/ifc-cd.c: Likewise. * gcc.dg/tree-ssa/pr19210-1.c: Likewise. * gcc.dg/tree-ssa/pr45122.c: Likewise. * gcc.target/i386/pr45352-2.c: Likewise. * gcc.target/i386/zee.c: Likewise. * gfortran.dg/auto_char_len_2.f90: Likewise. * gfortran.dg/auto_char_len_4.f90: Likewise. * gfortran.dg/c_ptr_tests_15.f90: Likewise. * gfortran.dg/char_array_structure_constructor.f90: Likewise. * gfortran.dg/gomp/pr47331.f90: Likewise. * gfortran.dg/pr40999.f: Likewise. * gfortran.dg/pr41011.f: Likewise. * gfortran.dg/pr42051.f03: Likewise. * gfortran.dg/pr46804.f90: Likewise. * gfortran.dg/pr83149_1.f90: Likewise. * gfortran.dg/pr83149_b.f90: Likewise. * gfortran.dg/whole_file_1.f90: Likewise. * gfortran.dg/whole_file_10.f90: Likewise. * gfortran.dg/whole_file_11.f90: Likewise. * gfortran.dg/whole_file_12.f90: Likewise. * gfortran.dg/whole_file_13.f90: Likewise. * gfortran.dg/whole_file_14.f90: Likewise. * gfortran.dg/whole_file_15.f90: Likewise. * gfortran.dg/whole_file_16.f90: Likewise. * gfortran.dg/whole_file_17.f90: Likewise. * gfortran.dg/whole_file_18.f90: Likewise. * gfortran.dg/whole_file_19.f90: Likewise. * gfortran.dg/whole_file_2.f90: Likewise. * gfortran.dg/whole_file_20.f03: Likewise. * gfortran.dg/whole_file_3.f90: Likewise. * gfortran.dg/whole_file_4.f90: Likewise. * gfortran.dg/whole_file_5.f90: Likewise. * gfortran.dg/whole_file_6.f90: Likewise. * gfortran.dg/whole_file_7.f90: Likewise. * gfortran.dg/whole_file_8.f90: Likewise. * gfortran.dg/whole_file_9.f90: Likewise. * gcc.dg/vect/vect.exp: Likewise. 2018-08-17 Martin Liska <mliska@suse.cz> * c.opt: Remove Warn, Init and Report for options with Ignore/Deprecated flag. Warning is done automatically for Deprecated flags. From-SVN: r263614
2018-07-20PR middle-end/82063 - issues with arguments enabled by -WallMartin Sebor1-8/+13
gcc/ada/ChangeLog: PR middle-end/82063 * gcc-interface/misc.c (gnat_handle_option): Change function argument to HOST_WIDE_INT. gcc/brig/ChangeLog: PR middle-end/82063 * brig/brig-lang.c (brig_langhook_handle_option): Change function argument to HOST_WIDE_INT. gcc/c-family/ChangeLog: PR middle-end/82063 * c-common.h (c_common_handle_option): Change function argument to HOST_WIDE_INT. * c-opts.c (c_common_init_options): Same. (c_common_handle_option): Same. Remove special handling of OPT_Walloca_larger_than_ and OPT_Wvla_larger_than_. * c.opt (-Walloc-size-larger-than, -Walloca-larger-than): Change options to take a HOST_WIDE_INT argument and accept a byte-size suffix. Initialize. (-Wvla-larger-than): Same. (-Wno-alloc-size-larger-than, -Wno-alloca-larger-than): New. (-Wno-vla-larger-than): Same. gcc/fortran/ChangeLog: PR middle-end/82063 * gfortran.h (gfc_handle_option): Change function argument to HOST_WIDE_INT. * options.c (gfc_handle_option): Same. gcc/go/ChangeLog: PR middle-end/82063 * go-lang.c (go_langhook_handle_option): Change function argument to HOST_WIDE_INT. gcc/lto/ChangeLog: PR middle-end/82063 * lto-lang.c (lto_handle_option): Change function argument to HOST_WIDE_INT. gcc/testsuite/ChangeLog: PR middle-end/82063 * gcc/testsuite/c-c++-common/pr68657-1.c: Adjust. * gcc/testsuite/c-c++-common/pr68657-2.c: Same. * gcc/testsuite/c-c++-common/pr68657-3.c: Same. * gcc.dg/Walloc-size-larger-than-16.c: Same. * gcc.dg/Walloca-larger-than.c: New test. * gcc.dg/Walloca-larger-than-2.c: New test. * gcc.dg/Wframe-larger-than-2.c: New test. * gcc.dg/Wlarger-than3.c: New test. * gcc.dg/Wvla-larger-than-3.c: New test. * gcc.dg/pr42611.c: Adjust. * gnat.dg/frame_overflow.adb: Same. gcc/ChangeLog: PR middle-end/82063 * builtins.c (expand_builtin_alloca): Adjust. * calls.c (alloc_max_size): Simplify. * cgraphunit.c (cgraph_node::expand): Adjust. * common.opt (larger_than_size, warn_frame_larger_than): Remove variables. (frame_larger_than_size): Same. (-Wframe-larger-than, -Wlarger-than, -Wstack-usage): Change options to take a HOST_WIDE_INT argument and accept a byte-size suffix. Initialize. * doc/invoke.texi (GCC Command Options): Document option arguments. Explain byte-size arguments and suffixes. (-Wvla-larger-than, -Wno-alloc-size-larger-than): Update. (-Wno-alloca-larger-than, -Wno-vla-larger-than): Same. (-Wframe-larger-than, -Wlarger-than, -Wstack-usage): Same. * doc/options.texi (UInteger): Expand. (Host_Wide_Int, ByteSize): Document new properties. * final.c (final_start_function_1): Include sizes in an error message. * function.c (frame_offset_overflow): Same. * gimple-ssa-warn-alloca.c (pass_walloca::gate): Adjust. (alloca_call_type_by_arg): Change function argument to HOST_WIDE_INT. Diagnose unbounded alloca calls only for limits of less than PTRDIFF_MAX. (alloca_call_type): Adjust. Diagnose possibly out-of-bounds alloca calls and VLA size only for limits of less than PTRDIFF_MAX. Same for alloca(0). (pass_walloca::execute): Adjust. Diagnose alloca calls in loops only for limits of less than PTRDIFF_MAX. * langhooks-def.h (lhd_handle_option): Change function argument to HOST_WIDE_INT. * langhooks.c (lhd_handle_option): Same. * langhooks.h (handle_option): Same. * opt-functions.awk (switch_bit_fields): Handle Host_Wide_Int and ByteSize flags. (var_type, var_type_struct): Same. (var_set): Handle ByteSize flag. * optc-gen.awk: Add comments to output to ease debugging. Make use of HOST_WIDE_INT where appropriate. * opts-gen-save.awk: Use %lx to format unsigned long. * opth-gen.awk: Change function argument to HOST_WIDE_INT. * opts-common.c (integral_argument): Return HOST_WIDE_INT and add arguments. Parse bytes-size suffixes. (enum_arg_to_value): Change function argument to HOST_WIDE_INT. (enum_value_to_arg): Same. (decode_cmdline_option): Handle cl_host_wide_int. Adjust. (handle_option): Adjust. (generate_option): Change function argument to HOST_WIDE_INT. (cmdline_handle_error): Adjust. (read_cmdline_option): Change function argument to HOST_WIDE_INT. (set_option): Change function argument to HOST_WIDE_INT. (option_enabled): Handle cl_host_wide_int. (get_option_state): Handle CLVC_SIZE. (control_warning_option): Same. * opts.c (common_handle_option): Change function argument to HOST_WIDE_INT. Remove handling of OPT_Walloca_larger_than_ and OPT_Wvla_larger_than_. * opts.h (enum cl_var_type): Add an enumerator. * stor-layout.c (layout_decl): Print a more meaningful warning. * toplev.c (output_stack_usage): Adjust. From-SVN: r262910
2018-01-03Update copyright years.Jakub Jelinek1-1/+1
From-SVN: r256169
2017-09-21enable handling of -gno- command-line options as negated prefixesAlexandre Oliva1-2/+2
This patch that adds -g to the set of negatable prefixes along with -f, -m and -W. Besides the mapping from -gno- to negated -g in option_map and adding g to the [fmW] matches for negatable options, I had to introduce gno- as an remapping prefix, for the option searching machinery to backtrack to and recognize as a remapping prefix, instead of backtracking to -g and stopping at it as if no-* was its Joined argument. Adding such remapping prefixes to preempt further backtracking can be accomplished by introducing the prefix as an Undocumented option with a Joined argument and without Driver, Target, Common, or any language-specific option. Whenever we match such a fake options prefix, we abandon further backtracking (it matches, after all), but find_opt returns the same code it would if it hadn't found any match, so that we resort to option mapping. I've arranged for such remapping prefixes to not be considered when looking for and suggesting a correct spelling for misspelled options. While testing that, I found a few -W-started options that were not marked as RejectNegative but should (-Wno-a, is not something we'd like to suggest ;-) I've also marked as such -g-started options that it makes no sense to negate, and removed the explicit -gno- ones, allowing their opposites to be negated. for gcc/ChangeLog * common.opt (Wa, Wl, Wp, g, gz=): Add RejectNegative. (gno-column-info): Remove. (gcolumn-info): Drop RejectNegative. (gno-): New prefix. (gno-record-gcc-switches): Remove. (grecord-gcc-switches): Drop RejectNegative. (gno-split-dwarf): Remove. (gsplit-dwarf): Drop RejectNegative. (gno-strict-dwarf): Remove. (gstrict-dwarf): Drop RejectNegative. * config/darwin.opt (gfull, gused): Add RejectNegative. * dwarf2out.c (gen_producer_string): Drop gno-record-gcc-switches handler. * optc-gen.awk: Add g to prefixes with negative forms. * opts-common.c (remapping_prefix_p): New. (find_opt): Check it. (generate_canonical_option): Test g prefix. (option_map): Add -gno- mapping. (add_misspelling_candidates): Check remapping_prefix_p. for gcc/ada/ChangeLog * gcc-interface/lang.opt (gant, gnatO, gnat): Add RejectNegative. for gcc/c-family/ChangeLog * c.opt (gen-decls): Add RejectNegative. From-SVN: r253047
2017-07-27Validate that Init value is within range defined by IntegerRange.Martin Liska1-1/+2
2017-07-27 Martin Liska <mliska@suse.cz> * opt-functions.awk: Add validation of value of Init. * optc-gen.awk: Pass new argument. From-SVN: r250625
2017-06-28Introduce IntegerRange for options (PR driver/79659).Martin Liska1-2/+2
2017-06-28 Martin Liska <mliska@suse.cz> PR driver/79659 * common.opt: Add IntegerRange to various options. * opt-functions.awk (integer_range_info): New function. * optc-gen.awk: Add integer_range_info to cl_options struct. * opts-common.c (decode_cmdline_option): Handle CL_ERR_INT_RANGE_ARG. (cmdline_handle_error): Likewise. * opts.c (print_filtered_help): Show valid interval in when --help is provided. * opts.h (struct cl_option): Add range_min and range_max fields. * config/i386/i386.opt: Add IntegerRange for -mbranch-cost. 2017-06-28 Martin Liska <mliska@suse.cz> PR driver/79659 * c.opt: Add IntegerRange to various options. 2017-06-28 Martin Liska <mliska@suse.cz> PR driver/79659 * g++.dg/opt/pr79659.C: New test. From-SVN: r249734
2017-06-27predict.c (test_prediction_value_range): Use -1U instead of -1 to avoid ↵Jakub Jelinek1-1/+1
narrowing conversion warning. * predict.c (test_prediction_value_range): Use -1U instead of -1 to avoid narrowing conversion warning. * dumpfile.c (dump_options): Wrap all value into dump_flags_t cast to avoid narrowing conversion warning. * opt-functions.awk (var_ref): Return (unsigned short) -1 instead of -1. * optc-gen.awk (END): Expect (unsigned short) -1 instead of -1. From-SVN: r249683
2017-02-25re PR c/79677 (Weird handling of -Werror=)Jakub Jelinek1-2/+2
PR c/79677 * opts.h (handle_generated_option): Add GENERATED_P argument. * opts-common.c (handle_option): Adjust function comment. (handle_generated_option): Add GENERATED_P argument, pass it to handle_option. (control_warning_option): Pass false to handle_generated_option GENERATED_P. * opts.c (maybe_default_option): Pass true to handle_generated_option GENERATED_P. * optc-gen.awk: Likewise. ada/ * gcc-interface/misc.c (gnat_handle_option): Pass true to handle_generated_option GENERATED_P. testsuite/ * gcc.dg/pr79677.c: New test. From-SVN: r245728
2017-01-04optc-gen.awk: Emit #error for -W*/-f*/-m* Enum without RejectNegative.Jakub Jelinek1-0/+5
* optc-gen.awk: Emit #error for -W*/-f*/-m* Enum without RejectNegative. From-SVN: r244073
2017-01-01Update copyright years.Jakub Jelinek1-1/+1
From-SVN: r243994
2016-01-04Update copyright years.Jakub Jelinek1-1/+1
From-SVN: r232055
2015-08-09options.texi (EnabledBy): Document that the argument must be a Common option.Manuel López-Ibáñez1-5/+23
gcc/ChangeLog: 2015-08-09 Manuel López-Ibáñez <manu@gcc.gnu.org> * doc/options.texi (EnabledBy): Document that the argument must be a Common option. * doc/invoke.texi (Wnull-dereference): Move after Wnonnull. Not enabled by -Wall. * optc-gen.awk: Give nicer error messages. Detect if the argument of EnabledBy is not a Common option. * common.opt (Wnull-dereference): Not enabled by -Wall. * opt-functions.awk (lang_enabled_by): Nicer error messages. gcc/c-family/ChangeLog: 2015-08-09 Manuel López-Ibáñez <manu@gcc.gnu.org> * c.opt (Wchkp): Use LangEnabledBy instead of EnabledBy. From-SVN: r226751
2015-01-05Update copyright years.Jakub Jelinek1-1/+1
From-SVN: r219188
2014-11-29opt-functions.awk (lang_enabled_by): Support || for enabled-by.Tobias Burnus1-3/+11
2014-11-29 Tobias Burnus <burnus@net-b.de> Manuel López-Ibáñez <manu@gcc.gnu.org> gcc/ * opt-functions.awk (lang_enabled_by): Support || for enabled-by. * optc-gen.awk: Ditto. * doc/options.texi (LangEnabledBy, EnabledBy): Document the || syntax. gcc/fortran/ * lang.opt (Wtabs): Combine duplicated item into a single one using || for LangEnabledBy. Co-Authored-By: Manuel López-Ibáñez <manu@gcc.gnu.org> From-SVN: r218175
2014-09-04options.texi: Document that Var and Init are required if CPP is given.Manuel López-Ibáñez1-5/+14
gcc/ChangeLog: 2014-09-04 Manuel López-Ibáñez <manu@gcc.gnu.org> * doc/options.texi: Document that Var and Init are required if CPP is given. * optc-gen.awk: Require Var and Init if CPP is given. * common.opt (Wpedantic): Use Init. libcpp/ChangeLog: 2014-09-04 Manuel López-Ibáñez <manu@gcc.gnu.org> * macro.c (replace_args): Use cpp_pedwarning, cpp_warning and CPP_W flags. * include/cpplib.h: Add CPP_W_C90_C99_COMPAT and CPP_W_PEDANTIC. * init.c (cpp_create_reader): Do not init to -1 here. * expr.c (num_binary_op): Use cpp_pedwarning. gcc/c-family/ChangeLog: 2014-09-04 Manuel López-Ibáñez <manu@gcc.gnu.org> * c.opt (Wc90-c99-compat,Wc++-compat,Wcomment,Wendif-labels, Winvalid-pch,Wlong-long,Wmissing-include-dirs,Wmultichar,Wpedantic, (Wdate-time,Wtraditional,Wundef,Wvariadic-macros): Add CPP, Var and Init. * c-opts.c (c_common_handle_option): Do not handle here. (sanitize_cpp_opts): Likewise. * c-common.c (struct reason_option_codes_t): Handle CPP_W_C90_C99_COMPAT and CPP_W_PEDANTIC. gcc/testsuite/ChangeLog: 2014-09-04 Manuel López-Ibáñez <manu@gcc.gnu.org> * gcc.dg/cpp/endif-pedantic2.c: More general options do not override specific ones, but specific ones do. From-SVN: r214904
2014-08-19re PR preprocessor/60975 (-Wvariadic-macros does not print warning)Manuel López-Ibáñez1-0/+51
gcc/ChangeLog: 2014-08-20 Manuel López-Ibáñez <manu@gcc.gnu.org> PR c/60975 PR c/53063 * doc/options.texi (CPP): Document it. * doc/invoke.texi (Wvariadic-macros): Fix documentation. * optc-gen.awk: Handle CPP. * opth-gen.awk: Likewise. gcc/c-family/ChangeLog: 2014-08-20 Manuel López-Ibáñez <manu@gcc.gnu.org> PR c/60975 PR c/53063 * c.opt (Wvariadic-macros): Use CPP and LangEnabledBy. * c-opts.c (c_common_handle_option): Call cpp_handle_option_auto. (c_common_post_options): Call init_global_opts_from_cpp. (sanitize_cpp_opts): Do not handle Wvariadic-macros here. gcc/testsuite/ChangeLog: 2014-08-20 Manuel López-Ibáñez <manu@gcc.gnu.org> PR c/60975 PR c/53063 * gcc.dg/cpp/Wvariadic-1p.c: New test. From-SVN: r214200
2014-05-08re PR driver/61106 ([4.8/4.9] impliedness of -Wunused-parameter depends on ↵Matthias Klose1-2/+4
-W option ordering) gcc/ 2014-05-08 Manuel López-Ibáñez <manu@gcc.gnu.org> Matthias Klose <doko@ubuntu.com> PR driver/61106 * optc-gen.awk: Fix option handling for -Wunused-parameter. gcc/testsuite/ 2014-05-08 Matthias Klose <doko@ubuntu.com> PR driver/61106 * gcc-dg/unused-8a.c: New. * gcc-dg/unused-8b.c: Likewise. From-SVN: r210246
2014-01-02Update copyright years in gcc/Richard Sandiford1-1/+1
From-SVN: r206289
2013-01-10Update copyright years in gcc/Richard Sandiford1-2/+1
From-SVN: r195098
2012-11-07optc-gen.awk: Factor code out to...Manuel López-Ibáñez1-25/+4
2012-11-07 Manuel López-Ibáñez <manu@gcc.gnu.org> * optc-gen.awk: Factor code out to... * opt-functions.awk (lang_enabled_by): ... this new function. From-SVN: r193303
2012-10-16re PR c/53063 (encode group options in the .opt files)Manuel López-Ibáñez1-10/+38
2012-10-16 Manuel López-Ibáñez <manu@gcc.gnu.org> PR c/53063 PR c/40989 * doc/options.texi (EnabledBy): Document new form. * optc-gen.awk: Handle new form of EnabledBy. * common.opt (Wunused-but-set-parameter): Use EnabledBy. (Wunused-parameter): Likewise. * opts.c (finish_options): Do not handle them explicitly. * opt-functions.awk (search_var_name): New. From-SVN: r192503
2012-10-16re PR c/53063 (encode group options in the .opt files)Manuel López-Ibáñez1-9/+29
2012-10-16 Manuel López-Ibáñez <manu@gcc.gnu.org> PR c/53063 PR c/40989 gcc/ * optc-gen.awk: Handle new form of LangEnabledBy. * opts.c (set_Wstrict_aliasing): Declare here. Make static. * common.opt (Wstrict-aliasing=,Wstrict-overflow=): Do not use Init. * doc/options.texi (LangEnabledBy): Document new form. * flags.h (set_Wstrict_aliasing): Do not declare. c-family/ * c.opt (Wstrict-aliasing=,Wstrict-overflow=): Use LangEnabledBy. * c-opts.c (c_common_handle_option): Do not set them here. Add comment. (c_common_post_options): Likewise. testsuite/ * gcc.dg/Wstrict-overflow-24.c: New. From-SVN: r192502
2012-05-17c.opt (--pedantic-errors,-pedantic-errors): Do not handle here.Manuel López-Ibáñez1-8/+16
2012-05-17 Manuel López-Ibáñez <manu@gcc.gnu.org> c-family/ * c.opt (--pedantic-errors,-pedantic-errors): Do not handle here. * c-opts.c (c_common_handle_option): Do not handle explicitly Wreturn-type, Wwrite-strings, warn_ecpp, and -pedantic-errors. gcc/ * opts.c (common_handle_option): -pedantic-errors enables -Wpedantic. (enable_warning_as_error): Do not special case Wuninitialized. * optc-gen.awk: Add sanity checks. From-SVN: r187628
2012-05-14re PR c/53063 (encode group options in the .opt files)Manuel López-Ibáñez1-27/+85
2012-05-14 Manuel López-Ibáñez <manu@gcc.gnu.org> PR 53063 c-family/ * c.opt (Wc++0X-compat,Wdelete-non-virtual-dtor,Wjump-misses-init, Wreorder): Use LangEnabledBy. * c-opts.c (c_common_handle_option): Do not enable them explicitly. Call lang-specific generated functions. (c_common_post_options): Do not set them here. gcc/ * doc/options.texi: (LangEnabledBy): Document it. * optc-gen.awk: Handle LangEnabledBy. * opth-gen.awk: Generate declaration for lang-specific functions. * opt-read.awk: Record lang numbers. * opt-functions.awk (flag_set_p): Ignore the arguments of flags. (lang_sanitized_name): New. ada/ * gcc-interface/misc.c: Include opts.h and options.h before tm.h. (gnat_handle_option): Call lang-specific generated function. fortran/ * options.c (gfc_handle_option): Call lang-specific generated function. From-SVN: r187462
2012-05-13optc-gen.awk: Error instead of warning for conflicting help.Manuel López-Ibáñez1-3/+3
2012-05-13 Manuel López-Ibáñez <manu@gcc.gnu.org> gcc/ * optc-gen.awk: Error instead of warning for conflicting help. ada/ * gcc-interface/lang.opt (I): Comment out help text with no effect. (nostdinc): Comment out help text with no effect. From-SVN: r187437
2012-05-11re PR c/53063 (encode group options in the .opt files)Manuel López-Ibáñez1-1/+63
2012-05-11 Manuel López-Ibáñez <manu@gcc.gnu.org> PR 53063 gcc/ * doc/options.texi (EnabledBy): Document * opts.c: Include opts.h and options.h before tm.h. (finish_options): Do not handle some sub-options here... (common_handle_option): ... instead call common_handle_option_auto here. * optc-gen.awk: Handle EnabledBy. * opth-gen.awk: Declare common_handle_option_auto. * common.opt (Wuninitialized): Use EnabledBy. Delete Init. (Wmaybe-uninitialized): Likewise. (Wunused-but-set-variable): Likewise. (Wunused-function): Likewise. (Wunused-label): Likewise. (Wunused-value): Likewise. (Wunused-variable): Likewise. * opt-read.awk: Create opt_numbers array. ada/ * gcc-interface/misc.c (gnat_parse_file): Move before ... (gnat_handle_option): ... this. Use handle_generated_option. c-family/ * c-opts.c (c_common_handle_option): Use handle_generated_option to enable sub-options. fortran/ * options.c: Include diagnostics.h instead of diagnostics-core.h. (set_Wall): Do not see warn_unused here. (gfc_handle_option): Set it here using handle_generated_option. From-SVN: r187403
2011-09-02opts.c (print_specific_help): Fix off-by-one compare in assertion check.Gary Funck1-0/+3
2011-09-02 Gary Funck <gary@intrepid.com> * opts.c (print_specific_help): Fix off-by-one compare in assertion check. * opts.h (CL_PARAMS, CL_WARNING, CL_OPTIMIZATION, CL_DRIVER, CL_TARGET, CL_COMMON, CL_JOINED, CL_SEPARATE, CL_UNDOCUMENTED): Increase by +5 to allow for more languages. * optc-gen.awk: Generate #if that ensures that the number of languages is within the implementation-defined limit. From-SVN: r178491
2011-07-25genattr.c (write_upcase, [...]): Move to ...Joern Rennecke1-0/+1
* genattr.c (write_upcase, gen_attr <enum definition writing>): Move to ... * genattr-common.c ... here. (main): Call gen_attr. * optc-gen.awk: Make generated program include insn-attr-common.h . * Makefile.in (oprions.o): Depend on insn-attr-common.h From-SVN: r176769
2011-05-23optc-save-gen.awk: New.Joseph Myers1-370/+0
* optc-save-gen.awk: New. Based on optc-gen.awk. Don't generate parts of output shared with the driver. * optc-gen.awk: Don't generate parts of output not shared with the driver. * opth-gen.awk: Remove GCC_DRIVER conditionals. * doc/options.texi (SourcerInclude): Mention options-save.c. * Makefile.in (GCC_OBJS): Use options.o instead of gcc-options.o. (OBJS): Add options-save.o. (options-save.c, options-save.o): New. (options.o): Update dependencies. (gcc-options.o): Remove. (mostlyclean): Remove options-save.c. From-SVN: r174085
2011-05-21opt-read.awk: New.Joseph Myers1-95/+4
* opt-read.awk: New. Split out of optc-gen.awk and opth-gen.awk. * optc-gen.awk: Move common code to opt-read.awk. * opth-gen.awk: Likewise. * Makefile.in (options.c, s-options-h): Update to use opt-read.awk. From-SVN: r173995
2011-05-05opt-functions.awk (var_type_struct): Handle Enum options.Joseph Myers1-0/+2
* opt-functions.awk (var_type_struct): Handle Enum options. * optc-gen.awk: Don't check range of variables of character type. * config/rs6000/rs6000.c (rs6000_sched_insert_nops_str, rs6000_sched_costly_dep_str, rs6000_recip_name, rs6000_abi_name, rs6000_sdata_name, rs6000_explicit_options): Remove. (rs6000_option_override_internal): Check for -malign-power here. Use global_options_set instead of rs6000_explicit_options. (rs6000_parse_fpu_option): Remove. (rs6000_handle_option): Access variables via opts and opts_set pointers. Use error_at and warning_at. Add fall-through comments. Don't handle OPT_mcmodel_, OPT_maix_struct_return, OPT_msvr4_struct_return, OPT_mvrsave, OPT_mspe, OPT_mcall_, OPT_msdata_, OPT_mtls_size_, OPT_mtraceback_, OPT_mfloat_gprs_, OPT_msched_costly_dep_, OPT_malign_ or OPT_mrecip_ explicitly here. Don't use rs6000_parse_fpu_option. * config/rs6000/rs6000.h (fpu_type): Remove declaration. * config/rs6000/rs6000.opt (rs6000_long_double_type_size, rs6000_spe, rs6000_float_gprs): Remove TargetVariable entries. (mrecip=): Use Var. (mspe): Use Var and Save. (mtraceback=): Use Enum and Var. (rs6000_traceback_type): New Enum and EnumValue entries. (mfloat-gprs=): Use Enum, Var and Save. (rs6000_float_gprs): New Enum and EnumValue entries. (mlong-double-): use Var and Save. (msched-costly-dep=, minsert-sched-nops=): Use Var. (malign-): Use Enum and Var. (rs6000_alignment_flags): New Enum and EnumValue entries. (mfpu=): Use Enum. (fpu_type_t): New Enum and EnumValue entries. * config/rs6000/aix43.h (SUBTARGET_OVERRIDE_OPTIONS): Use global_options_set instead of rs6000_explicit_options. * config/rs6000/aix52.h (SUBTARGET_OVERRIDE_OPTIONS): Use global_options_set instead of rs6000_explicit_options. * config/rs6000/aix53.h (SUBTARGET_OVERRIDE_OPTIONS): Use global_options_set instead of rs6000_explicit_options. * config/rs6000/aix61.h (SUBTARGET_OVERRIDE_OPTIONS): Use global_options_set instead of rs6000_explicit_options. * config/rs6000/e500-double.h (SUB3TARGET_OVERRIDE_OPTIONS): Use global_options_set instead of rs6000_explicit_options. * config/rs6000/eabispe.h (SUBSUBTARGET_OVERRIDE_OPTIONS): Use global_options_set instead of rs6000_explicit_options. (RS6000_DEFAULT_LONG_DOUBLE_SIZE): Remove commented-out definition. * config/rs6000/linux64.h (SUBSUBTARGET_OVERRIDE_OPTIONS): Use global_options_set instead of rs6000_explicit_options. * config/rs6000/linux64.opt (mcmodel=): Use Enum and Var. (rs6000_cmodel): New Enum and EnumValue entries. * config/rs6000/linuxspe.h (SUBSUBTARGET_OVERRIDE_OPTIONS): Use global_options_set instead of rs6000_explicit_options. * config/rs6000/sysv4.opt (mcall-, msdata=): Use Var. (mtls-size=): Use Enum and Var. (rs6000_tls_size): New Enum and EnumValue entries. From-SVN: r173434
2011-04-04optc-gen.awk: Always remove type from Variable entry before recording in ↵Joseph Myers1-5/+6
var_seen. * optc-gen.awk: Always remove type from Variable entry before recording in var_seen. From-SVN: r171938
2011-03-31opts.h (cl_option): Add comments to fields.Joseph Myers1-3/+9
* opts.h (cl_option): Add comments to fields. Add bit-fields for various flags. (CL_SEPARATE_NARGS_SHIFT, CL_SEPARATE_NARGS_MASK, CL_SEPARATE_ALIAS, CL_NO_DRIVER_ARG, CL_REJECT_DRIVER, CL_SAVE, CL_DISABLED, CL_REPOR, CL_REJECT_NEGATIVE, CL_MISSING_OK, CL_UINTEGER, CL_NEGATIVE_ALIAS): Remove. (CL_JOINED, CL_SEPARATE, CL_UNDOCUMENTED): Update bit positions. * opt-functions.awk (flag_init, switch_bit_fields): New. (switch_flags): Don't handle flags moved to bit-fields. Don't generate CL_MISSING_OK or CL_SAVE. * optc-gen.awk: Update to generate bit-field output as well as flags field. * gcc.c (driver_wrong_lang_callback): Use cl_reject_driver bit-field instead of CL_REJECT_DRIVER flag. * opts-common.c (generate_canonical_option, decode_cmdline_option): Use bit-fields instead of CL_* flags. * opts.c (maybe_default_option): Use cl_reject_negative bit-field instead of CL_REJECT_NEGATIVE flag. * toplev.c (print_switch_values): Use cl_report bit-field instead of CL_REPORT flag. From-SVN: r171804
2011-03-30options.texi (NegativeAlias): Document.Joseph Myers1-0/+5
* doc/options.texi (NegativeAlias): Document. (Alias): Mention NegativeAlias. * opt-functions.awk: Handle NegativeAlias. * optc-gen.awk: Disallow NegativeAlias with multiple Alias arguments. * opts-common.c (decode_cmdline_option): Handle CL_NEGATIVE_ALIAS. * opts.h (CL_NEGATIVE_ALIAS): Define. * config/rs6000/rs6000.c (rs6000_parse_yes_no_option): Remove. (rs6000_handle_option): Don't handle OPT_mvrsave_, OPT_misel_ and OPT_mspe_. * config/rs6000/rs6000.opt (mvrsave=, misel=, mspe=): Replace with Alias entries. * config/rs6000/t-spe (MULTILIB_OPTIONS, MULTILIB_EXCEPTIONS): Use mno-spe and mno-isel instead of mspe=no and -misel=no. From-SVN: r171745
2011-02-08common.opt (fcx-limited-range): Add SetByCombined flag.Ian Lance Taylor1-1/+5
* common.opt (fcx-limited-range): Add SetByCombined flag. (ffinite-math-only, fmath-errno, frounding-math): Likewise. (fsignaling-nans, fsigned-zeros, ftrapping-math): Likewise. (fassociative-math, freciprocal-math): Likewise. (funsafe-math-optimizations): Likewise. * opth-gen.awk: Handle SetByCombined. * optc-gen.awk: Likewise. * opts.c (set_fast_math_flags): Don't override flag if set by frontend. (set_unsafe_math_optimizations_flags): Likewise. * doc/options.texi (Option properties): Document SetByCombined. From-SVN: r169930
2010-11-26options.texi (Enum, EnumValue): Document new record types.Joseph Myers1-0/+76
* doc/options.texi (Enum, EnumValue): Document new record types. (Enum): Document new option flag. * opt-functions.awk * optc-gen.awk: Handle enumerated option arguments. * opth-gen.awk: Handle enumerated option arguments. * opts-common.c (enum_arg_ok_for_language, enum_arg_to_value, enum_value_to_arg): New. (decode_cmdline_option): Handle enumerated arguments. (read_cmdline_option): Handle CL_ERR_ENUM_ARG. (set_option, option_enabled, get_option_state): Handle CLVC_ENUM. * opts.c (print_filtered_help, print_specific_help): Take lang_mask arguments. (print_filtered_help): Handle printing values of enumerated options. Print possible arguments for enumerated options. (print_specific_help): Update call to print_filtered_help. (common_handle_option): Update calls to print_specific_help. Use value rather than arg for OPT_fdiagnostics_show_location_. Don't handle OPT_ffp_contract_, OPT_fexcess_precision_, OPT_fvisibility_, OPT_ftls_model_, OPT_fira_algorithm_ or OPT_fira_region_ here. * opts.h (enum cl_var_type): Add CLVC_ENUM. (struct cl_option): Add var_enum. (CL_ENUM_CANONICAL, CL_ENUM_DRIVER_ONLY, struct cl_enum_arg, struct cl_enum, cl_enums, cl_enums_count): New. (CL_ERR_ENUM_ARG): Define. (CL_ERR_NEGATIVE): Update value. (enum_value_to_arg): Declare. * common.opt (flag_ira_algorithm, flag_ira_region, flag_fp_contract_mode, flag_excess_precision_cmdline, default_visibility, flag_tls_default): Remove Variable entries. (help_enum_printed): New Variable. (fdiagnostics-show-location=): Use Enum. Add associated SourceInclude, Enum and EnumValue entries. (fexcess-precision=, ffp-contract=, fira-algorithm=, fira-region=, ftls-model=, fvisibility=): Use Enum, Var and Init. Add associated Enum and EnumValue entries. po: * exgettext: Handle UnknownError. From-SVN: r167190
2010-11-19Add PowerPC target attribute/pragma supportMichael Meissner1-1/+88
From-SVN: r166947
2010-11-19common.opt (debug_struct_ordinary, [...]): New Variable entries.Joseph Myers1-0/+1
* common.opt (debug_struct_ordinary, debug_struct_generic): New Variable entries. * dwarf2out.c (matches_main_base, dump_struct_debug, DUMP_GSTRUCT, should_emit_struct_debug): Move from opts.c. * flag-types.h (enum debug_struct_file): Move from opts.c. * flags.h (should_emit_struct_debug): Remove. (base_of_path): Declare. (set_struct_debug_option): Add gcc_options parameter. * optc-gen.awk, opth-gen.awk: Handle array variables. * opts.c (enum debug_struct_file, debug_struct_ordinary, debug_struct_generic): Remove. (set_struct_debug_option): Add gcc_options parameter. (base_of_path): Remove static. (main_input_basename, main_input_baselength, matches_main_base, dump_struct_debug, DUMP_GSTRUCT, should_emit_struct_debug): Remove. * toplev.c (main_input_basename, main_input_baselength): Define here. * toplev.h (main_input_basename, main_input_baselength): Declare here. c-family: * c-opts.c (c_common_handle_option): Update calls to set_struct_debug_option. From-SVN: r166944
2010-10-11Fix PR bootstrap/35855: awk character classes.Ralf Wildenhues1-1/+1
gcc/: PR bootstrap/35855 * opt-functions.awk (BEGIN): New section. (lower, upper, digit, alnum): New variables. (static_var, opt_sanitized_name): Use alnum instead of character classes, for non-C locale. * optc-gen.awk: Likewise. * opth-gen.awk: Likewise. From-SVN: r165322
2010-10-08Makefile.in (TM_H): Include $(FLAGS_H) instead of options.h.Joseph Myers1-1/+2
* Makefile.in (TM_H): Include $(FLAGS_H) instead of options.h. (TREE_H): Include $(FLAGS_H) instead of options.h. (opts-common.o): Depend on $(FLAGS_H) instead of options.h. * c-objc-common.h (LANG_HOOKS_INIT_OPTIONS_STRUCT): Define. * common.opt (flag_complex_method, flag_evaluation_order, flag_ira_algorithm, flag_ira_region, flag_warn_unused_result): New Variable declarations. * configure.ac (tm_include_list): Include flags.h instead of options.h. * configure: Regenerate. * flags.h: Condition out contents for target libraries. Include options.h at end of file. (flag_complex_method, flag_ira_algorithm, flag_ira_region, flag_evaluation_order, flag_warn_unused_result): Remove. * gcc.c (main): Intialize global_options with global_options_init. * langhooks-def.h (lhd_init_options_struct): Declare. (LANG_HOOKS_INIT_OPTIONS_STRUCT): Define. (LANG_HOOKS_INITIALIZER): Include LANG_HOOKS_INIT_OPTIONS_STRUCT. * langhooks.c (lhd_init_options_struct): New. * langhooks.h (struct lang_hooks): Add init_options_struct. Update comment on init_options. * optc-gen.awk: Generate initializer for global_options_init, not global_options. * opth-gen.awk: Condition out structure declarations for target libraries. Declare global_options_init. * opts-common.c: Include flags.h instead of options.h. * opts.c (flag_warn_unused_result): Remove. (read_cmdline_options): Take gcc_options parameters. Pass them to read_cmdline_option. (initial_lang_mask, initial_min_crossjump_insns, initial_max_fields_for_field_sensitive, initial_loop_invariant_max_bbs_in_loop): Define at file scope. (init_options_once): New. Split out of decode_options. (init_options_struct): New. Split out of decode_options. (decode_cmdline_options_to_array_default_mask): New. (default_options_optimization): New. Split out of decode_options. (decode_options): Move most code to other functions. Update call to read_cmdline_options. (finish_options): New. Split out of decode_options. * opts.h (decode_options): Add gcc_options parameters. (init_options_once, init_options_struct, decode_cmdline_options_to_array_default_mask): New. * toplev.c (flag_complex_method, flag_ira_algorithm, flag_ira_region, flag_evaluation_order): Remove. (general_init): Use global_options_init for initial flag values for global_dc. (toplev_main): Call init_options_once, init_options_struct, lang_hooks.init_options_struct, decode_cmdline_options_to_array_default_mask and lang_hooks.init_option before decode_options. Update arguments to decode_options. * tree.h: Include flags.h instead of options.h. ada: * gcc-interface/misc.c (gnat_init_options_struct): New. Split out from gnat_init_options. (LANG_HOOKS_INIT_OPTIONS_STRUCT): Define. c-family: * c-common.c (parse_optimize_options): Call decode_cmdline_options_to_array_default_mask before decode_options. Update arguments to decode_options. * c-common.h (c_common_init_options_struct): Declare. * c-opts.c (c_common_init_options_struct): New. Split out from c_common_init_options. cp: * cp-objcp-common.h (LANG_HOOKS_INIT_OPTIONS_STRUCT): Define. fortran: * f95-lang.c (LANG_HOOKS_INIT_OPTIONS_STRUCT): Define. * gfortran.h (gfc_init_options_struct): Declare. * options.c (gfc_init_options_struct): New. Split out from gfc_init_options. java: * lang.c (java_init_options_struct): New. Split out from java_init_options. (LANG_HOOKS_INIT_OPTIONS_STRUCT): Define. lto: * lto-lang.c (lto_init_options): Change to lto_init_options_struct. Update parameters. (LANG_HOOKS_INIT_OPTIONS): Don't define. (LANG_HOOKS_INIT_OPTIONS_STRUCT): Define. From-SVN: r165189
2010-10-04optc-gen.awk: Define global_options_set.Joseph Myers1-3/+3
* optc-gen.awk: Define global_options_set. Don't define target_flags_explicit. * opth-gen.awk: Declare global_options_set. Define target_flags_explicit as macro. * opts-common.c (handle_option): Take opts_set and generated_p parameters. (handle_generated_option, read_cmdline_option, set_option): Take opts_set parameter. (set_option): Use opts_set instead of hardcoding target_flags and target_flags_explicit. * opts.c (sel_sched_switch_set, profile_arc_flag_set, flag_profile_values_set, flag_unroll_loops_set, flag_tracer_set, flag_value_profile_transformations_set, flag_peel_loops_set, flag_branch_probabilities_set, flag_inline_functions_set, flag_ipa_cp_set, flag_ipa_cp_clone_set, flag_predictive_commoning_set, flag_unswitch_loops_set, flag_gcse_after_reload_set): Remove. (common_handle_option, lang_handle_option, target_handle_option): Take opts_set parameter. Assert that it is &global_options_set. (common_handle_option): Don't set _set variables. Check opts_set instead of such variables. (enable_warning_as_error): Pass &global_options_set to handle_generated_option. * opts.h (cl_option_handler_func.handler, set_option, handle_option, handle_generated_option, read_cmdline_option): Add opts_set parameters. (handle_option): Add generated_p parameter. * config/i386/i386.c (ix86_function_specific_save, ix86_function_specific_restore): Updat for renaming of target_flags_explicit field. * config/i386/i386.opt (target_flags_explicit): Rename to ix86_target_flags_explicit. * config/ia64/ia64.c (ia64_override_options_after_change): Check global_options_set.x_flag_selective_scheduling and global_options_set.x_flag_selective_scheduling2, not sel_sched_switch_set. * flags.h (sel_sched_switch_set, flag_speculative_prefetching_set): Remove. * gcc.c (driver_handle_option): Take opts_set parameter. Assert that it is &global_options_set. (process_command): Pass &global_options_set to read_cmdline_option. * lto-opts.c (lto_reissue_options): Pass &global_options_set to set_option. * toplev.c (target_flags_explicit): Remove. c-family: * c-opts.c (c_common_handle_option): Pass &global_options_set to handle_generated_option. From-SVN: r164932
2010-09-30opt-functions.awk (static_var): Update comment.Joseph Myers1-29/+28
* opt-functions.awk (static_var): Update comment. (var_ref): Return offsetof expression or -1, not variable address. * optc-gen.awk: Generate structure field initializers instead of static variables. Expect -1 for missing variables instead of null pointer. Add gcc_options parameters to generated functions. * opth-gen.awk: Generate structure fields for static variables. Add gcc_options parameters to generated functions. * common.opt (optimize, optimize_size): Add variables. * config/i386/i386-c.c (ix86_pragma_target_parse): Pass &global_options to cl_target_option_restore. * config/i386/i386.c (ix86_valid_target_attribute_p): Pass &global_options to cl_optimization_restore, cl_target_option_save and cl_target_option_restore. (ix86_set_current_function): Pass &global_options to cl_target_option_restore. * config/pdp11/pdp11.h (optimize): Remove. * config/rs6000/rs6000.h (optimize): Remove. * config/sh/sh.h (optimize): Remove. * config/xtensa/xtensa.h (optimize): Remove. * coretypes.h (struct gcc_options): Declare. * diagnostic.c (diagnostic_initialize): Initialize context->option_state. (diagnostic_report_diagnostic): Pass option_state to option_enabled hook. * diagnostic.h (diagnostic_context.option_enabled): Add void * parameter. (diagnostic_context.option_state): New field. * final.c (final_start_function, final, final_scan_insn): Rename optimize parameter to optimize_p. * flags.h (optimize, optimize_size): Remove. * function.c (invoke_set_current_function_hook): Pass &global_options to cl_optimization_restore. * gcc.c (driver_handle_option): Take gcc_options parameter. Assert that it is &global_options. (process_command): Pass &global_options to read_cmdline_option. * ipa-pure-const.c (suggest_attribute): Pass &global_options to option_enabled. * lto-opts.c (lto_reissue_options): Use option_flag_var. Pass &global_options to set_option. * opts-common.c (handle_option, handle_generated_option, read_cmdline_option, set_option): Take explicit gcc_options parameters. Use option_flag_var. (option_flag_var): New. * opts.c (common_handle_option, lang_handle_option, target_handle_option): Take gcc_options parameter. Assert that it is &global_options. (read_cmdline_options): Pass &global_options to read_cmdline_option. (print_filtered_help): Use option_flag_var. Pass &global_options to option_enabled. (common_handle_option): Use option_flag_var. (option_enabled): Take opts parameter. Use option_flag_var. (get_option_state): Take gcc_options parameter. Use option_flag_var. Pass gcc_options parameter to option_enabled. (enable_warning_as_error): Pass &global_options to handle_generated_option. * opts.h (struct cl_option): Change flag_var to flag_var_offset. (cl_option_handler_func.handler): Take gcc_options parameter. (option_enabled, get_option_state, set_option, handle_option, handle_generated_option, read_cmdline_option): Take gcc_options parameters. * toplev.c (optimize, optimize_size): Remove. (print_switch_values): Pass &global_options to option_enabled. (option_affects_pch_p): Use option_flag_var. Pass &global_options to get_option_state. (general_init): Initialize global_dc->option_state. * tree.c (build_optimization_node): Pass &global_options to cl_optimization_save. (build_target_option_node): Pass &global_options to cl_target_option_save. c-family: * c-common.c (handle_optimize_attribute): Pass &global_options to cl_optimization_save and cl_optimization_restore. * c-opts.c (c_common_handle_option): Pass &global_options to handle_generated_option. * c-pragma.c (handle_pragma_diagnostic): Use option_flag_var. (handle_pragma_pop_options, handle_pragma_reset_options): Pass &global_options to cl_optimization_restore. From-SVN: r164751
2010-09-29optc-gen.awk: Generate global_options initializer instead of individual ↵Joseph Myers1-46/+64
variables. gcc: * optc-gen.awk: Generate global_options initializer instead of individual variables. Add x_ prefix to names of structure members. * opth-gen.awk: Generate gcc_options structure. Add x_ prefix to names of structure members. * doc/tm.texi.in (HARD_FRAME_POINTER_IS_FRAME_POINTER, HARD_FRAME_POINTER_IS_ARG_POINTER): Document. * doc/tm.texi: Regenerate. * alias.c: Use HARD_FRAME_POINTER_IS_FRAME_POINTER * builtins.c: Use HARD_FRAME_POINTER_IS_ARG_POINTER. * c-parser.c (disable_extension_diagnostics, restore_extension_diagnostics): Update names of cpp_options members. * combine.c: Use HARD_FRAME_POINTER_IS_FRAME_POINTER * common.opt (fcompare-debug-second): Don't use Var. * config/alpha/alpha.h (target_flags): Remove. * config/arm/arm.h (HARD_FRAME_POINTER_IS_FRAME_POINTER, HARD_FRAME_POINTER_IS_ARG_POINTER): Define. * config/bfin/bfin.h (target_flags): Remove. * config/cris/cris.h (target_flags): Remove. * config/i386/i386-c.c (ix86_pragma_target_parse): Update names of cl_target_option members. * config/i386/i386.c (ix86_force_align_arg_pointer): Remove. (ix86_function_specific_print, ix86_valid_target_attribute_tree, ix86_can_inline_p): Update names of cl_target_option members. * config/i386/i386.h (ix86_isa_flags): Remove. * config/lm32/lm32.h (target_flags): Remove. * config/mcore/mcore.h (mcore_stack_increment): Remove. * config/mcore/mcore.md (addsi3): Remove extern declaration of flag_omit_frame_pointer. * config/mep/mep.h (target_flags): Remove. * config/mips/mips.h (HARD_FRAME_POINTER_IS_FRAME_POINTER, HARD_FRAME_POINTER_IS_ARG_POINTER): Define. * config/mmix/mmix.h (target_flags): Remove. * config/rs6000/rs6000.h (rs6000_xilinx_fpu, flag_pic, flag_expensive_optimizations): Remove. * config/s390/s390.h (flag_pic): Remove. * config/score/score-conv.h (target_flags): Remove. * config/sh/sh.h (sh_fixed_range_str): Remove. * config/spu/spu.h (target_flags, spu_fixed_range_string): Remove. * dbxout.c: Use HARD_FRAME_POINTER_IS_ARG_POINTER * df-scan.c: Use HARD_FRAME_POINTER_IS_FRAME_POINTER. * diagnostic.c (diagnostic_initialize): Update names of diagnostic_context members. * diagnostic.h (diagnostic_context): Rename inhibit_warnings and warn_system_headers. (diagnostic_report_warnings_p): Update for new names. * dwarf2out.c: Use HARD_FRAME_POINTER_IS_ARG_POINTER * emit-rtl.c: Use HARD_FRAME_POINTER_IS_FRAME_POINTER and HARD_FRAME_POINTER_IS_ARG_POINTER. * flags.h (flag_compare_debug): Declare. * ira.c: Use HARD_FRAME_POINTER_IS_FRAME_POINTER * opts.c (flag_compare_debug): Define. (common_handle_option): Update names of diagnostic_context members. Handle -fcompare-debug-second. (fast_math_flags_struct_set_p): Update names of cl_optimization members. * reginfo.c: Use HARD_FRAME_POINTER_IS_FRAME_POINTER. * regrename.c: Use HARD_FRAME_POINTER_IS_FRAME_POINTER. * reload.c: Use HARD_FRAME_POINTER_IS_FRAME_POINTER. * reload1.c: Use HARD_FRAME_POINTER_IS_FRAME_POINTER. * resource.c: Use HARD_FRAME_POINTER_IS_FRAME_POINTER. * rtl.h (HARD_FRAME_POINTER_IS_FRAME_POINTER, HARD_FRAME_POINTER_IS_ARG_POINTER): Define and use. * sel-sched.c: Use HARD_FRAME_POINTER_IS_FRAME_POINTER * stmt.c: Use HARD_FRAME_POINTER_IS_ARG_POINTER. gcc/c-family: * c-common.c (c_cpp_error): Update names of diagnostic_context members. * c-cppbuiltin.c (c_cpp_builtins_optimize_pragma): Update names of cl_optimization members. * c-opts.c (warning_as_error_callback, c_common_handle_option, sanitize_cpp_opts, finish_options): Update names of cpp_options members. gcc/fortran: * cpp.c (cpp_define_builtins): Update names of gfc_option_t members. (gfc_cpp_post_options): Update names of cpp_options members. (cb_cpp_error): Update names of diagnostic_context members. * f95-lang.c (gfc_init_builtin_functions): Update names of gfc_option_t members. * gfortran.h (gfc_option_t): Rename warn_conversion and flag_openmp. * intrinsic.c (gfc_convert_type_warn): Update names of gfc_option_t members. * options.c (gfc_init_options, gfc_post_options, set_Wall, gfc_handle_option): Update names of gfc_option_t members. * parse.c (next_free, next_fixed): Update names of gfc_option_t members. * scanner.c (pedantic): Remove extern declaration. (skip_free_comments, skip_fixed_comments, include_line): Update names of gfc_option_t members. * trans-decl.c (gfc_generate_function_code): Update names of gfc_option_t members. gcc/java: * java-tree.h (flag_filelist_file, flag_assert, flag_jni, flag_force_classes_archive_check, flag_redundant, flag_newer, flag_use_divide_subroutine, flag_use_atomic_builtins, flag_use_boehm_gc, flag_hash_synchronization, flag_check_references, flag_optimize_sci, flag_indirect_classes, flag_indirect_dispatch, flag_store_check, flag_reduced_reflection): Remove. * jcf-dump.c (flag_newer): Remove. * jcf.h (quiet_flag): Remove. * parse.h (quiet_flag): Remove. libcpp: * include/cpplib.h (cpp_options): Rename warn_deprecated, warn_traditional, warn_long_long and pedantic. * directives.c (directive_diagnostics, _cpp_handle_directive): Update names of cpp_options members. * expr.c (cpp_classify_number, eval_token): Update names of cpp_options members. * init.c (cpp_create_reader, post_options): Update names of cpp_options members. * internal.h (CPP_PEDANTIC, CPP_WTRADITIONAL): Update names of cpp_options members. * macro.c (parse_params): Update names of cpp_options members. From-SVN: r164723
2010-09-17options.texi (Variable): Document.Joseph Myers1-11/+9
* 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. From-SVN: r164370
2010-09-02opts.h (struct cl_option): Add warn_message field.Joseph Myers1-3/+13
* opts.h (struct cl_option): Add warn_message field. (struct cl_decoded_option): Add warn_message field. * doc/options.texi (Ignore, Warn): Document. * opt-functions.awk (needs_state_p): Don't consider aliases or ignored options to need state saved. * optc-gen.awk: Handle Warn and Ignore. * opth-gen.awk: Output OPT_SPECIAL_ignore. * opts-common.c (decode_cmdline_option): Set warn_message field. Handle ignored options. (decode_cmdline_options_to_array, generate_option, generate_option_input_file): Set warn_message field. (read_cmdline_option): Generate warnings from warn_message field. Handle ignored options. * common.opt (Wunreachable-code, fargument-alias, fargument-noalias, fargument-noalias-global, fargument-noalias-anything, fcse-skip-blocks, fforce-addr, floop-optimize, frerun-loop-opt, fsched2-use-traces, fsee, fstrength-reduce, ftree-store-ccp, ftree-store-copy-prop, ftree-salias): Mark Ignore. * config/i386/i386.h (CC1_CPU_SPEC_1): Don't handle -mcpu, -mintel-syntax and -mno-intel-syntax here. * config/i386/i386.opt (mcpu=, mintel-syntax): Define as aliases using Warn. * opts.c (common_handle_option): Don't handle options marked as ignored. (enable_warning_as_error): Handle ignored options. c-family: * c.opt (Wimport, fall-virtual, falt-external-templates, fdefault-inline, fenum-int-equiv, fexternal-templates, fguiding-decls, fhonor-std, fhuge-objects, flabels-ok, fname-mangling-version-, fnew-abi, fnonnull-objects, foptional-diags, fsquangle, fstrict-prototype, fthis-is-variable, fvtable-gc, fvtable-thunks, fxref): Mark with Ignore and Warn as applicable. (fhandle-exceptions): Mark with Alias and Warn. * c-opts.c (c_common_handle_option): Don't handle options marked as ignored. po: * exgettext: Handle {} in operand of MissingArgError. Handle Warn. From-SVN: r163771
2010-09-02re PR driver/44076 (-MT <target> behaves different as -MT<target> (w/o space))Joseph Myers1-2/+32
PR driver/44076 * opts.h (struct cl_option): Add alias_arg, neg_alias_arg and alias_target fields. * opt-functions.awk (opt_sanitized_name): Don't handle finline-limit=, Wlarger-than= and ftemplate-depth= specially. * optc-gen.awk: Generate alias fields. * opth-gen.awk: Explicitly give values for OPT_* enum constants. Don't generate such constants for aliases. * opts-common.c (generate_canonical_option): New. (decode_cmdline_option): Handle aliases. Use generate_canonical_option for known options instead of copying the input option text. * doc/options.texi (Alias): Document. * common.opt (W, Wlarger-than-, aux-info=, finline-limit-, fstack-check, specs): Mark as aliases. * gcc.c (driver_handle_option): Canonicalize -L options to joined arguments. (driver_handle_option): Don't handle OPT_specs. * opts.c (common_handle_option): Don't handle options marked as aliases. (enable_warning_as_error): Handle aliases. * stor-layout.c (layout_decl): Use OPT_Wlarger_than_ instead of OPT_Wlarger_than_eq. * tree-optimize.c (tree_rest_of_compilation): Use OPT_Wlarger_than_ instead of OPT_Wlarger_than_eq. c-family: * c.opt (Wcomments, Werror-implicit-function-declaration, ftemplate-depth-, std=c89, std=c9x, std=gnu89, std=gnu9x, std=iso9899:1990, std=iso9899:1999, std=iso9899:199x): Mark as aliases. * c-common.c (option_codes): Use OPT_Wcomment instead of OPT_Wcomments. * c-opts.c (warning_as_error_callback, c_common_handle_option): Don't handle options marked as aliases. java: * lang.opt (CLASSPATH, bootclasspath, classpath, encoding, fCLASSPATH=): Mark as Java options and as aliases. * jvspec.c (jvgenmain_spec): Don't handle -fCLASSPATH*. (lang_specific_driver): Don't handle options marked as aliases. * lang.c (java_handle_option): Don't handle OPT_fCLASSPATH_. testsuite: * gcc.dg/cpp/warn-comments-3.c: New. Based on warn-comments-2.c but using -Werror=comment. * gcc.dg/cpp/warn-comments.c, gcc.dg/cpp/warn-comments-2.c: Adjust expected error messages. From-SVN: r163770
2010-07-27coretypes.h (struct cl_option_handlers): Declare.Joseph Myers1-0/+1
* coretypes.h (struct cl_option_handlers): Declare. * hooks.c (hook_int_size_t_constcharptr_int_0): Remove. * hooks.h (hook_int_size_t_constcharptr_int_0): Remove. * langhooks-def.h (lhd_handle_option): Declare. (LANG_HOOKS_HANDLE_OPTION): Use lhd_handle_option. * langhooks.c (lhd_handle_option): New. * langhooks.h (struct lang_hooks): Update prototype and return value type of handle_option hook. * optc-gen.awk: Generate target_flags_explicit definition for the driver. * opts-common.c: Include diagnostic.h. (handle_option): Move from opts.c. Update prototype and return value type. Use handlers structure. (read_cmdline_option): Move from opts.c. Update prototype. Use handlers structure. (set_option): Move from opts.c. * opts.c (common_handle_option): Update prototype and return value type. Update calls to handle_option and enable_warning_as_error. (unknown_option_callback, post_handling_callback, lang_handle_option, target_handle_option): New. (handle_option, read_cmdline_option): Move to opts-common.c. (read_cmdline_options): Update prototype. Update call to read_cmdline_option. (decode_options): Initialize and use handlers structure. (set_option): Move to opts-common.c. (enable_warning_as_error): Update prototype. Update call to handle_option. * opts.h (struct cl_option_handler_func, struct cl_option_handlers): New. (handle_option, enable_warning_as_error): Update prototypes. (read_cmdline_option): Declare. * Makefile.in (opts-common.o): Update dependencies. ada: * gcc-interface/misc.c (gnat_handle_option): Update prototype and return value type. Don't check for missing arguments here. c-family: * c-common.h (c_common_handle_option): Update prototype and return value type. * c-opts.c (c_common_handle_option): Update prototype and return value type. Update calls to handle_option and enable_warning_as_error. fortran: * gfortran.h (gfc_handle_option): Update prototype and return value type. * options.c (gfc_handle_option): Update prototype and return value type. java: * lang.c (java_handle_option): Update prototype and return value type. lto: * lto-lang.c (lto_handle_option): Update prototype and return value type. Remove duplicate assignment to result. From-SVN: r162601