Commit 3713f2e2 by Martin Liska Committed by Martin Liska

Come up with Deprecated option flag.

2018-06-12  Martin Liska  <mliska@suse.cz>

	* doc/options.texi: Document Deprecated option flag.
2018-06-12  Martin Liska  <mliska@suse.cz>

	* config/i386/i386.opt: Make MPX-related options as Deprecated.
	* opt-functions.awk: Handle Deprecated flag.
	* opts-common.c (decode_cmdline_option): Handle cl_deprecated
        and report error.
	(read_cmdline_option): Report warning for a deprecated option.
	* opts.h (struct cl_option): Add new field cl_deprecated.
	(CL_ERR_DEPRECATED): New.
2018-06-12  Martin Liska  <mliska@suse.cz>

	* c.opt: Make MPX-related options as Deprecated.
2018-06-12  Martin Liska  <mliska@suse.cz>

	* g++.dg/opt/mpx.C: New test.
	* gcc.target/i386/mpx.c: New test.

From-SVN: r261497
parent 09d69286
2018-06-12 Martin Liska <mliska@suse.cz>
* config/i386/i386.opt: Make MPX-related options as Deprecated.
* opt-functions.awk: Handle Deprecated flag.
* opts-common.c (decode_cmdline_option): Handle cl_deprecated
and report error.
(read_cmdline_option): Report warning for a deprecated option.
* opts.h (struct cl_option): Add new field cl_deprecated.
(CL_ERR_DEPRECATED): New.
2018-06-12 Martin Liska <mliska@suse.cz>
* doc/options.texi: Document Deprecated option flag.
2018-06-12 Claudiu Zissulescu <claziss@synopsys.com> 2018-06-12 Claudiu Zissulescu <claziss@synopsys.com>
* config/arc/arc-arch.h (arc_extras): New enum. * config/arc/arc-arch.h (arc_extras): New enum.
......
2018-06-12 Martin Liska <mliska@suse.cz>
* c.opt: Make MPX-related options as Deprecated.
2018-06-08 David Malcolm <dmalcolm@redhat.com> 2018-06-08 David Malcolm <dmalcolm@redhat.com>
* c-pretty-print.c (c_pretty_printer::statement): Use TDF_NONE * c-pretty-print.c (c_pretty_printer::statement): Use TDF_NONE
......
...@@ -409,7 +409,7 @@ C ObjC C++ ObjC++ Var(warn_char_subscripts) Warning LangEnabledBy(C ObjC C++ Obj ...@@ -409,7 +409,7 @@ C ObjC C++ ObjC++ Var(warn_char_subscripts) Warning LangEnabledBy(C ObjC C++ Obj
Warn about subscripts whose type is \"char\". Warn about subscripts whose type is \"char\".
Wchkp Wchkp
C ObjC C++ ObjC++ Var(warn_chkp) Warning LangEnabledBy(C ObjC C++ ObjC++,Wall) C ObjC C++ ObjC++ Var(warn_chkp) Warning LangEnabledBy(C ObjC C++ ObjC++,Wall) Deprecated
Deprecated in GCC 9. This switch has no effect. Deprecated in GCC 9. This switch has no effect.
Wclobbered Wclobbered
...@@ -1259,86 +1259,86 @@ C ObjC C++ ObjC++ ...@@ -1259,86 +1259,86 @@ C ObjC C++ ObjC++
Where shorter, use canonicalized paths to systems headers. Where shorter, use canonicalized paths to systems headers.
fcheck-pointer-bounds fcheck-pointer-bounds
C ObjC C++ ObjC++ LTO Report Var(flag_check_pointer_bounds) C ObjC C++ ObjC++ LTO Report Var(flag_check_pointer_bounds) Deprecated
Deprecated in GCC 9. This switch has no effect. Deprecated in GCC 9. This switch has no effect.
fchkp-check-incomplete-type fchkp-check-incomplete-type
C ObjC C++ ObjC++ LTO Report Var(flag_chkp_incomplete_type) Init(1) C ObjC C++ ObjC++ LTO Report Var(flag_chkp_incomplete_type) Init(1) Deprecated
Deprecated in GCC 9. This switch has no effect. Deprecated in GCC 9. This switch has no effect.
fchkp-zero-input-bounds-for-main fchkp-zero-input-bounds-for-main
C ObjC C++ ObjC++ LTO Report Var(flag_chkp_zero_input_bounds_for_main) Init(0) C ObjC C++ ObjC++ LTO Report Var(flag_chkp_zero_input_bounds_for_main) Init(0) Deprecated
Deprecated in GCC 9. This switch has no effect. Deprecated in GCC 9. This switch has no effect.
fchkp-first-field-has-own-bounds fchkp-first-field-has-own-bounds
C ObjC C++ ObjC++ LTO RejectNegative Report Var(flag_chkp_first_field_has_own_bounds) C ObjC C++ ObjC++ LTO RejectNegative Report Var(flag_chkp_first_field_has_own_bounds) Deprecated
Deprecated in GCC 9. This switch has no effect. Deprecated in GCC 9. This switch has no effect.
fchkp-narrow-bounds fchkp-narrow-bounds
C ObjC C++ ObjC++ LTO Report Var(flag_chkp_narrow_bounds) Init(1) C ObjC C++ ObjC++ LTO Report Var(flag_chkp_narrow_bounds) Init(1) Deprecated
Deprecated in GCC 9. This switch has no effect. Deprecated in GCC 9. This switch has no effect.
fchkp-narrow-to-innermost-array fchkp-narrow-to-innermost-array
C ObjC C++ ObjC++ LTO RejectNegative Report Var(flag_chkp_narrow_to_innermost_arrray) C ObjC C++ ObjC++ LTO RejectNegative Report Var(flag_chkp_narrow_to_innermost_arrray) Deprecated
Deprecated in GCC 9. This switch has no effect. Deprecated in GCC 9. This switch has no effect.
fchkp-flexible-struct-trailing-arrays fchkp-flexible-struct-trailing-arrays
C ObjC C++ ObjC++ LTO Report Var(flag_chkp_flexible_struct_trailing_arrays) C ObjC C++ ObjC++ LTO Report Var(flag_chkp_flexible_struct_trailing_arrays) Deprecated
Deprecated in GCC 9. This switch has no effect. Deprecated in GCC 9. This switch has no effect.
fchkp-optimize fchkp-optimize
C ObjC C++ ObjC++ LTO Report Var(flag_chkp_optimize) Init(-1) C ObjC C++ ObjC++ LTO Report Var(flag_chkp_optimize) Init(-1)
fchkp-use-fast-string-functions fchkp-use-fast-string-functions
C ObjC C++ ObjC++ LTO Report Var(flag_chkp_use_fast_string_functions) Init(0) C ObjC C++ ObjC++ LTO Report Var(flag_chkp_use_fast_string_functions) Init(0) Deprecated
Deprecated in GCC 9. This switch has no effect. Deprecated in GCC 9. This switch has no effect.
fchkp-use-nochk-string-functions fchkp-use-nochk-string-functions
C ObjC C++ ObjC++ LTO Report Var(flag_chkp_use_nochk_string_functions) Init(0) C ObjC C++ ObjC++ LTO Report Var(flag_chkp_use_nochk_string_functions) Init(0) Deprecated
Deprecated in GCC 9. This switch has no effect. Deprecated in GCC 9. This switch has no effect.
fchkp-use-static-bounds fchkp-use-static-bounds
C ObjC C++ ObjC++ LTO Report Var(flag_chkp_use_static_bounds) Init(1) C ObjC C++ ObjC++ LTO Report Var(flag_chkp_use_static_bounds) Init(1) Deprecated
Deprecated in GCC 9. This switch has no effect. Deprecated in GCC 9. This switch has no effect.
fchkp-use-static-const-bounds fchkp-use-static-const-bounds
C ObjC C++ ObjC++ LTO Report Var(flag_chkp_use_static_const_bounds) Init(-1) C ObjC C++ ObjC++ LTO Report Var(flag_chkp_use_static_const_bounds) Init(-1) Deprecated
Deprecated in GCC 9. This switch has no effect. Deprecated in GCC 9. This switch has no effect.
fchkp-treat-zero-dynamic-size-as-infinite fchkp-treat-zero-dynamic-size-as-infinite
C ObjC C++ ObjC++ LTO Report Var(flag_chkp_zero_dynamic_size_as_infinite) Init(0) C ObjC C++ ObjC++ LTO Report Var(flag_chkp_zero_dynamic_size_as_infinite) Init(0) Deprecated
Deprecated in GCC 9. This switch has no effect. Deprecated in GCC 9. This switch has no effect.
fchkp-check-read fchkp-check-read
C ObjC C++ ObjC++ LTO Report Var(flag_chkp_check_read) Init(1) C ObjC C++ ObjC++ LTO Report Var(flag_chkp_check_read) Init(1) Deprecated
Deprecated in GCC 9. This switch has no effect. Deprecated in GCC 9. This switch has no effect.
fchkp-check-write fchkp-check-write
C ObjC C++ ObjC++ LTO Report Var(flag_chkp_check_write) Init(1) C ObjC C++ ObjC++ LTO Report Var(flag_chkp_check_write) Init(1) Deprecated
Deprecated in GCC 9. This switch has no effect. Deprecated in GCC 9. This switch has no effect.
fchkp-store-bounds fchkp-store-bounds
C ObjC C++ ObjC++ LTO Report Var(flag_chkp_store_bounds) Init(1) C ObjC C++ ObjC++ LTO Report Var(flag_chkp_store_bounds) Init(1) Deprecated
Deprecated in GCC 9. This switch has no effect. Deprecated in GCC 9. This switch has no effect.
fchkp-instrument-calls fchkp-instrument-calls
C ObjC C++ ObjC++ LTO Report Var(flag_chkp_instrument_calls) Init(1) C ObjC C++ ObjC++ LTO Report Var(flag_chkp_instrument_calls) Init(1) Deprecated
Deprecated in GCC 9. This switch has no effect. Deprecated in GCC 9. This switch has no effect.
fchkp-instrument-marked-only fchkp-instrument-marked-only
C ObjC C++ ObjC++ LTO Report Var(flag_chkp_instrument_marked_only) Init(0) C ObjC C++ ObjC++ LTO Report Var(flag_chkp_instrument_marked_only) Init(0) Deprecated
Deprecated in GCC 9. This switch has no effect. Deprecated in GCC 9. This switch has no effect.
fchkp-use-wrappers fchkp-use-wrappers
C ObjC C++ ObjC++ LTO Report Var(flag_chkp_use_wrappers) Init(1) C ObjC C++ ObjC++ LTO Report Var(flag_chkp_use_wrappers) Init(1) Deprecated
Deprecated in GCC 9. This switch has no effect. Deprecated in GCC 9. This switch has no effect.
static-libmpx static-libmpx
Driver Driver Deprecated
Deprecated in GCC 9. This switch has no effect. Deprecated in GCC 9. This switch has no effect.
static-libmpxwrappers static-libmpxwrappers
Driver Driver Deprecated
Deprecated in GCC 9. This switch has no effect. Deprecated in GCC 9. This switch has no effect.
fcilkplus Undocumented fcilkplus Undocumented
......
...@@ -951,7 +951,7 @@ Target Report Mask(ISA_RTM) Var(ix86_isa_flags) Save ...@@ -951,7 +951,7 @@ Target Report Mask(ISA_RTM) Var(ix86_isa_flags) Save
Support RTM built-in functions and code generation. Support RTM built-in functions and code generation.
mmpx mmpx
Target Report Target Report Deprecated
Deprecated in GCC 9. This switch has no effect. Deprecated in GCC 9. This switch has no effect.
mmwaitx mmwaitx
......
...@@ -280,6 +280,10 @@ The state of this option should be stored in variable @var{var} ...@@ -280,6 +280,10 @@ The state of this option should be stored in variable @var{var}
(actually a macro for @code{global_options.x_@var{var}}). (actually a macro for @code{global_options.x_@var{var}}).
The way that the state is stored depends on the type of option: The way that the state is stored depends on the type of option:
@item Deprecated
The option is deprecated and every usage of such option will
result in a warning.
@itemize @bullet @itemize @bullet
@item @item
If the option uses the @code{Mask} or @code{InverseMask} properties, If the option uses the @code{Mask} or @code{InverseMask} properties,
......
...@@ -136,7 +136,8 @@ function switch_bit_fields (flags) ...@@ -136,7 +136,8 @@ function switch_bit_fields (flags)
flag_init("UInteger", flags) \ flag_init("UInteger", flags) \
flag_init("Host_Wide_Int", hwi) \ flag_init("Host_Wide_Int", hwi) \
flag_init("ToLower", flags) \ flag_init("ToLower", flags) \
flag_init("Report", flags) flag_init("Report", flags) \
flag_init("Deprecated", flags)
sub(", $", "", result) sub(", $", "", result)
return result return result
......
...@@ -667,6 +667,10 @@ decode_cmdline_option (const char **argv, unsigned int lang_mask, ...@@ -667,6 +667,10 @@ decode_cmdline_option (const char **argv, unsigned int lang_mask,
if (!option_ok_for_language (option, lang_mask)) if (!option_ok_for_language (option, lang_mask))
errors |= CL_ERR_WRONG_LANG; errors |= CL_ERR_WRONG_LANG;
/* Mark all deprecated options. */
if (option->cl_deprecated)
errors |= CL_ERR_DEPRECATED;
/* Convert the argument to lowercase if appropriate. */ /* Convert the argument to lowercase if appropriate. */
if (arg && option->cl_tolower) if (arg && option->cl_tolower)
{ {
...@@ -1250,6 +1254,12 @@ read_cmdline_option (struct gcc_options *opts, ...@@ -1250,6 +1254,12 @@ read_cmdline_option (struct gcc_options *opts,
return; return;
} }
if (decoded->errors & CL_ERR_DEPRECATED)
{
warning_at (loc, 0, "deprecated command line option %qs", opt);
return;
}
gcc_assert (!decoded->errors); gcc_assert (!decoded->errors);
if (!handle_option (opts, opts_set, decoded, lang_mask, DK_UNSPECIFIED, if (!handle_option (opts, opts_set, decoded, lang_mask, DK_UNSPECIFIED,
......
...@@ -100,6 +100,8 @@ struct cl_option ...@@ -100,6 +100,8 @@ struct cl_option
BOOL_BITFIELD cl_tolower : 1; BOOL_BITFIELD cl_tolower : 1;
/* Report argument with -fverbose-asm */ /* Report argument with -fverbose-asm */
BOOL_BITFIELD cl_report : 1; BOOL_BITFIELD cl_report : 1;
/* Deprecated option */
BOOL_BITFIELD cl_deprecated: 1;
/* Offset of field for this option in struct gcc_options, or /* Offset of field for this option in struct gcc_options, or
(unsigned short) -1 if none. */ (unsigned short) -1 if none. */
unsigned short flag_var_offset; unsigned short flag_var_offset;
...@@ -209,6 +211,7 @@ extern const unsigned int cl_enums_count; ...@@ -209,6 +211,7 @@ extern const unsigned int cl_enums_count;
#define CL_ERR_NEGATIVE (1 << 6) /* Negative form of option #define CL_ERR_NEGATIVE (1 << 6) /* Negative form of option
not permitted (together not permitted (together
with OPT_SPECIAL_unknown). */ with OPT_SPECIAL_unknown). */
#define CL_ERR_DEPRECATED (1 << 7) /* Deprecated option. */
/* Structure describing the result of decoding an option. */ /* Structure describing the result of decoding an option. */
......
2018-06-12 Martin Liska <mliska@suse.cz>
* g++.dg/opt/mpx.C: New test.
* gcc.target/i386/mpx.c: New test.
2018-06-12 Claudiu Zissulescu <claziss@synopsys.com> 2018-06-12 Claudiu Zissulescu <claziss@synopsys.com>
* gcc.target/arc/builtin_simdarc.c: Update test. * gcc.target/arc/builtin_simdarc.c: Update test.
......
// { dg-do compile }
// { dg-options "-fcheck-pointer-bounds -fchkp-first-field-has-own-bounds" }
// { dg-warning "deprecated command line option .-fcheck-pointer-bounds." "" { target *-*-* } 0 }
// { dg-warning "deprecated command line option .-fchkp-first-field-has-own-bounds." "" { target *-*-* } 0 }
/* { dg-do compile } */
// { dg-options "-mmpx" }
// { dg-warning "deprecated command line option .-mmpx." "" { target *-*-* } 0 }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment