diff options
author | Martin Liska <mliska@suse.cz> | 2018-08-17 11:25:56 +0200 |
---|---|---|
committer | Martin Liska <marxin@gcc.gnu.org> | 2018-08-17 09:25:56 +0000 |
commit | c0c1235622280db4a55cd86daa176b08b72f1210 (patch) | |
tree | 4595d1f36634c32f0064a293e5955f353287ee6d /gcc/opts-common.c | |
parent | 36a072b429a9501946cb1fafdc9b1af7c574594d (diff) |
Merge Ignore and Deprecated in .opt files.
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
Diffstat (limited to 'gcc/opts-common.c')
-rw-r--r-- | gcc/opts-common.c | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/gcc/opts-common.c b/gcc/opts-common.c index 11356442e7b..2b5f63844fb 100644 --- a/gcc/opts-common.c +++ b/gcc/opts-common.c @@ -663,13 +663,13 @@ decode_cmdline_option (const char **argv, unsigned int lang_mask, { size_t new_opt_index = option->alias_target; - if (new_opt_index == OPT_SPECIAL_ignore) + if (new_opt_index == OPT_SPECIAL_ignore + || new_opt_index == OPT_SPECIAL_deprecated) { gcc_assert (option->alias_arg == NULL); gcc_assert (option->neg_alias_arg == NULL); opt_index = new_opt_index; arg = NULL; - value = 1; } else { @@ -744,10 +744,6 @@ decode_cmdline_option (const char **argv, unsigned int lang_mask, if (!option_ok_for_language (option, lang_mask)) errors |= CL_ERR_WRONG_LANG; - /* Mark all deprecated options. */ - if (option->cl_deprecated) - errors |= CL_ERR_DEPRECATED; - /* Convert the argument to lowercase if appropriate. */ if (arg && option->cl_tolower) { @@ -823,7 +819,8 @@ decode_cmdline_option (const char **argv, unsigned int lang_mask, else decoded->canonical_option[i] = NULL; } - if (opt_index != OPT_SPECIAL_unknown && opt_index != OPT_SPECIAL_ignore) + if (opt_index != OPT_SPECIAL_unknown && opt_index != OPT_SPECIAL_ignore + && opt_index != OPT_SPECIAL_deprecated) { generate_canonical_option (opt_index, arg, value, decoded); if (separate_args > 1) @@ -1001,6 +998,7 @@ prune_options (struct cl_decoded_option **decoded_options, { case OPT_SPECIAL_unknown: case OPT_SPECIAL_ignore: + case OPT_SPECIAL_deprecated: case OPT_SPECIAL_program_name: case OPT_SPECIAL_input_file: goto keep; @@ -1324,6 +1322,14 @@ read_cmdline_option (struct gcc_options *opts, if (decoded->opt_index == OPT_SPECIAL_ignore) return; + if (decoded->opt_index == OPT_SPECIAL_deprecated) + { + /* Warn only about positive ignored options. */ + if (decoded->value) + warning_at (loc, 0, "switch %qs is no longer supported", opt); + return; + } + option = &cl_options[decoded->opt_index]; if (decoded->errors @@ -1337,12 +1343,6 @@ read_cmdline_option (struct gcc_options *opts, return; } - if (decoded->errors & CL_ERR_DEPRECATED) - { - warning_at (loc, 0, "deprecated command line option %qs", opt); - return; - } - gcc_assert (!decoded->errors); if (!handle_option (opts, opts_set, decoded, lang_mask, DK_UNSPECIFIED, @@ -1619,7 +1619,7 @@ control_warning_option (unsigned int opt_index, int kind, const char *arg, arg = cl_options[opt_index].alias_arg; opt_index = cl_options[opt_index].alias_target; } - if (opt_index == OPT_SPECIAL_ignore) + if (opt_index == OPT_SPECIAL_ignore || opt_index == OPT_SPECIAL_deprecated) return; if (dc) diagnostic_classify_diagnostic (dc, opt_index, (diagnostic_t) kind, loc); |