Commit 2d2bd949 by Joseph Myers Committed by Joseph Myers

opts.h (struct cl_option): Add warn_message field.

	* 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
parent 5de8299c
2010-09-02 Joseph Myers <joseph@codesourcery.com> 2010-09-02 Joseph Myers <joseph@codesourcery.com>
* 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.
2010-09-02 Joseph Myers <joseph@codesourcery.com>
PR driver/44076 PR driver/44076
* opts.h (struct cl_option): Add alias_arg, neg_alias_arg and * opts.h (struct cl_option): Add alias_arg, neg_alias_arg and
alias_target fields. alias_target fields.
......
2010-09-02 Joseph Myers <joseph@codesourcery.com> 2010-09-02 Joseph Myers <joseph@codesourcery.com>
* 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.
2010-09-02 Joseph Myers <joseph@codesourcery.com>
* c.opt (Wcomments, Werror-implicit-function-declaration, * c.opt (Wcomments, Werror-implicit-function-declaration,
ftemplate-depth-, std=c89, std=c9x, std=gnu89, std=gnu9x, ftemplate-depth-, std=c89, std=c9x, std=gnu89, std=gnu9x,
std=iso9899:1990, std=iso9899:1999, std=iso9899:199x): Mark as std=iso9899:1990, std=iso9899:1999, std=iso9899:199x): Mark as
......
...@@ -537,10 +537,6 @@ c_common_handle_option (size_t scode, const char *arg, int value, ...@@ -537,10 +537,6 @@ c_common_handle_option (size_t scode, const char *arg, int value,
value, c_family_lang_mask, kind, handlers); value, c_family_lang_mask, kind, handlers);
break; break;
case OPT_Wimport:
/* Silently ignore for now. */
break;
case OPT_Winvalid_pch: case OPT_Winvalid_pch:
cpp_opts->warn_invalid_pch = value; cpp_opts->warn_invalid_pch = value;
break; break;
...@@ -623,25 +619,6 @@ c_common_handle_option (size_t scode, const char *arg, int value, ...@@ -623,25 +619,6 @@ c_common_handle_option (size_t scode, const char *arg, int value,
flag_cond_mismatch = value; flag_cond_mismatch = value;
break; break;
} }
/* Fall through. */
case OPT_fall_virtual:
case OPT_falt_external_templates:
case OPT_fenum_int_equiv:
case OPT_fexternal_templates:
case OPT_fguiding_decls:
case OPT_fhonor_std:
case OPT_fhuge_objects:
case OPT_flabels_ok:
case OPT_fname_mangling_version_:
case OPT_fnew_abi:
case OPT_fnonnull_objects:
case OPT_fsquangle:
case OPT_fstrict_prototype:
case OPT_fthis_is_variable:
case OPT_fvtable_thunks:
case OPT_fxref:
case OPT_fvtable_gc:
warning (0, "switch %qs is no longer supported", option->opt_text); warning (0, "switch %qs is no longer supported", option->opt_text);
break; break;
...@@ -672,10 +649,6 @@ c_common_handle_option (size_t scode, const char *arg, int value, ...@@ -672,10 +649,6 @@ c_common_handle_option (size_t scode, const char *arg, int value,
constant_string_class_name = arg; constant_string_class_name = arg;
break; break;
case OPT_fdefault_inline:
/* Ignore. */
break;
case OPT_fextended_identifiers: case OPT_fextended_identifiers:
cpp_opts->extended_identifiers = value; cpp_opts->extended_identifiers = value;
break; break;
...@@ -684,11 +657,6 @@ c_common_handle_option (size_t scode, const char *arg, int value, ...@@ -684,11 +657,6 @@ c_common_handle_option (size_t scode, const char *arg, int value,
flag_next_runtime = !value; flag_next_runtime = !value;
break; break;
case OPT_fhandle_exceptions:
warning (0, "-fhandle-exceptions has been renamed -fexceptions (and is now on by default)");
flag_exceptions = value;
break;
case OPT_fnext_runtime: case OPT_fnext_runtime:
flag_next_runtime = value; flag_next_runtime = value;
break; break;
...@@ -697,10 +665,6 @@ c_common_handle_option (size_t scode, const char *arg, int value, ...@@ -697,10 +665,6 @@ c_common_handle_option (size_t scode, const char *arg, int value,
cpp_opts->operator_names = value; cpp_opts->operator_names = value;
break; break;
case OPT_foptional_diags:
/* Ignore. */
break;
case OPT_fpch_deps: case OPT_fpch_deps:
cpp_opts->restore_pch_deps = value; cpp_opts->restore_pch_deps = value;
break; break;
......
...@@ -275,7 +275,7 @@ C ObjC Var(warn_implicit_int) Init(-1) Warning ...@@ -275,7 +275,7 @@ C ObjC Var(warn_implicit_int) Init(-1) Warning
Warn when a declaration does not specify a type Warn when a declaration does not specify a type
Wimport Wimport
C ObjC C++ ObjC++ Undocumented C ObjC C++ ObjC++ Undocumented Ignore
Wint-to-pointer-cast Wint-to-pointer-cast
C ObjC C++ ObjC++ Var(warn_int_to_pointer_cast) Init(1) Warning C ObjC C++ ObjC++ Var(warn_int_to_pointer_cast) Init(1) Warning
...@@ -534,10 +534,10 @@ C++ ObjC++ Var(flag_access_control) Init(1) ...@@ -534,10 +534,10 @@ C++ ObjC++ Var(flag_access_control) Init(1)
Enforce class member access control semantics Enforce class member access control semantics
fall-virtual fall-virtual
C++ ObjC++ C++ ObjC++ Ignore Warn(switch %qs is no longer supported)
falt-external-templates falt-external-templates
C++ ObjC++ C++ ObjC++ Ignore Warn(switch %qs is no longer supported)
Change when template instances are emitted Change when template instances are emitted
fasm fasm
...@@ -572,7 +572,7 @@ C++ ObjC++ Var(flag_deduce_init_list) Init(1) ...@@ -572,7 +572,7 @@ C++ ObjC++ Var(flag_deduce_init_list) Init(1)
-fno-deduce-init-list disable deduction of std::initializer_list for a template type parameter from a brace-enclosed initializer-list -fno-deduce-init-list disable deduction of std::initializer_list for a template type parameter from a brace-enclosed initializer-list
fdefault-inline fdefault-inline
C++ ObjC++ C++ ObjC++ Ignore
Does nothing. Preserved for backward compatibility. Does nothing. Preserved for backward compatibility.
fdirectives-only fdirectives-only
...@@ -591,7 +591,7 @@ C++ ObjC++ Var(flag_enforce_eh_specs) Init(1) ...@@ -591,7 +591,7 @@ C++ ObjC++ Var(flag_enforce_eh_specs) Init(1)
Generate code to check exception specifications Generate code to check exception specifications
fenum-int-equiv fenum-int-equiv
C++ ObjC++ C++ ObjC++ Ignore Warn(switch %qs is no longer supported)
fexec-charset= fexec-charset=
C ObjC C++ ObjC++ Joined RejectNegative C ObjC C++ ObjC++ Joined RejectNegative
...@@ -607,7 +607,7 @@ C ObjC C++ ObjC++ Joined RejectNegative ...@@ -607,7 +607,7 @@ C ObjC C++ ObjC++ Joined RejectNegative
fexternal-templates fexternal-templates
C++ ObjC++ C++ ObjC++ Ignore Warn(switch %qs is no longer supported)
ffor-scope ffor-scope
C++ ObjC++ Var(flag_new_for_scope) Init(1) C++ ObjC++ Var(flag_new_for_scope) Init(1)
...@@ -630,20 +630,20 @@ C ObjC Var(flag_gnu89_inline) Init(-1) ...@@ -630,20 +630,20 @@ C ObjC Var(flag_gnu89_inline) Init(-1)
Use traditional GNU semantics for inline functions Use traditional GNU semantics for inline functions
fguiding-decls fguiding-decls
C++ ObjC++ C++ ObjC++ Ignore Warn(switch %qs is no longer supported)
fhandle-exceptions fhandle-exceptions
C++ ObjC++ Optimization C++ ObjC++ Optimization Alias(fexceptions) Warn({-fhandle-exceptions has been renamed -fexceptions (and is now on by default)})
fhonor-std fhonor-std
C++ ObjC++ C++ ObjC++ Ignore Warn(switch %qs is no longer supported)
fhosted fhosted
C ObjC C ObjC
Assume normal C execution environment Assume normal C execution environment
fhuge-objects fhuge-objects
C++ ObjC++ C++ ObjC++ Ignore Warn(switch %qs is no longer supported)
Enable support for huge objects Enable support for huge objects
fimplement-inlines fimplement-inlines
...@@ -663,7 +663,7 @@ C++ ObjC++ Var(flag_friend_injection) ...@@ -663,7 +663,7 @@ C++ ObjC++ Var(flag_friend_injection)
Inject friend functions into enclosing namespace Inject friend functions into enclosing namespace
flabels-ok flabels-ok
C++ ObjC++ C++ ObjC++ Ignore Warn(switch %qs is no longer supported)
flax-vector-conversions flax-vector-conversions
C ObjC C++ ObjC++ Var(flag_lax_vector_conversions) C ObjC C++ ObjC++ Var(flag_lax_vector_conversions)
...@@ -674,10 +674,10 @@ C ObjC C++ ObjC++ Var(flag_ms_extensions) ...@@ -674,10 +674,10 @@ C ObjC C++ ObjC++ Var(flag_ms_extensions)
Don't warn about uses of Microsoft extensions Don't warn about uses of Microsoft extensions
fname-mangling-version- fname-mangling-version-
C++ ObjC++ Joined C++ ObjC++ Joined Ignore Warn(switch %qs is no longer supported)
fnew-abi fnew-abi
C++ ObjC++ C++ ObjC++ Ignore Warn(switch %qs is no longer supported)
fnext-runtime fnext-runtime
ObjC ObjC++ ObjC ObjC++
...@@ -691,7 +691,7 @@ fnonansi-builtins ...@@ -691,7 +691,7 @@ fnonansi-builtins
C++ ObjC++ Var(flag_no_nonansi_builtin, 0) C++ ObjC++ Var(flag_no_nonansi_builtin, 0)
fnonnull-objects fnonnull-objects
C++ ObjC++ C++ ObjC++ Ignore Warn(switch %qs is no longer supported)
fnothrow-opt fnothrow-opt
C++ ObjC++ Optimization Var(flag_nothrow_opt) C++ ObjC++ Optimization Var(flag_nothrow_opt)
...@@ -731,7 +731,7 @@ C++ ObjC++ ...@@ -731,7 +731,7 @@ C++ ObjC++
Recognize C++ keywords like \"compl\" and \"xor\" Recognize C++ keywords like \"compl\" and \"xor\"
foptional-diags foptional-diags
C++ ObjC++ C++ ObjC++ Ignore
Does nothing. Preserved for backward compatibility. Does nothing. Preserved for backward compatibility.
fpch-deps fpch-deps
...@@ -786,7 +786,7 @@ C ObjC C++ ObjC++ LTO Var(flag_signed_char) ...@@ -786,7 +786,7 @@ C ObjC C++ ObjC++ LTO Var(flag_signed_char)
Make \"char\" signed by default Make \"char\" signed by default
fsquangle fsquangle
C++ ObjC++ C++ ObjC++ Ignore Warn(switch %qs is no longer supported)
fstats fstats
C++ ObjC++ Var(flag_detailed_statistics) C++ ObjC++ Var(flag_detailed_statistics)
...@@ -797,7 +797,7 @@ C++ ObjC++ Optimization Var(flag_strict_enums) ...@@ -797,7 +797,7 @@ C++ ObjC++ Optimization Var(flag_strict_enums)
Assume that values of enumeration type are always within the minimum range of that type Assume that values of enumeration type are always within the minimum range of that type
fstrict-prototype fstrict-prototype
C++ ObjC++ C++ ObjC++ Ignore Warn(switch %qs is no longer supported)
ftabstop= ftabstop=
C ObjC C++ ObjC++ Joined RejectNegative UInteger C ObjC C++ ObjC++ Joined RejectNegative UInteger
...@@ -811,7 +811,7 @@ C++ ObjC++ Joined RejectNegative UInteger ...@@ -811,7 +811,7 @@ C++ ObjC++ Joined RejectNegative UInteger
-ftemplate-depth=<number> Specify maximum template instantiation depth -ftemplate-depth=<number> Specify maximum template instantiation depth
fthis-is-variable fthis-is-variable
C++ ObjC++ C++ ObjC++ Ignore Warn(switch %qs is no longer supported)
fthreadsafe-statics fthreadsafe-statics
C++ ObjC++ Optimization Var(flag_threadsafe_statics) Init(1) C++ ObjC++ Optimization Var(flag_threadsafe_statics) Init(1)
...@@ -842,11 +842,11 @@ C++ ObjC++ Var(flag_visibility_ms_compat) ...@@ -842,11 +842,11 @@ C++ ObjC++ Var(flag_visibility_ms_compat)
Changes visibility to match Microsoft Visual Studio by default Changes visibility to match Microsoft Visual Studio by default
fvtable-gc fvtable-gc
C++ ObjC++ C++ ObjC++ Ignore Warn(switch %qs is no longer supported)
Discard unused virtual functions Discard unused virtual functions
fvtable-thunks fvtable-thunks
C++ ObjC++ C++ ObjC++ Ignore Warn(switch %qs is no longer supported)
Implement vtables using thunks Implement vtables using thunks
fweak fweak
...@@ -862,7 +862,7 @@ C ObjC C++ ObjC++ Var(flag_working_directory) Init(-1) ...@@ -862,7 +862,7 @@ C ObjC C++ ObjC++ Var(flag_working_directory) Init(-1)
Generate a #line directive pointing at the current working directory Generate a #line directive pointing at the current working directory
fxref fxref
C++ ObjC++ C++ ObjC++ Ignore Warn(switch %qs is no longer supported)
Emit cross referencing information Emit cross referencing information
fzero-link fzero-link
......
...@@ -248,7 +248,7 @@ Common Var(warn_uninitialized) Init(-1) Warning ...@@ -248,7 +248,7 @@ Common Var(warn_uninitialized) Init(-1) Warning
Warn about uninitialized automatic variables Warn about uninitialized automatic variables
Wunreachable-code Wunreachable-code
Common Common Ignore
Does nothing. Preserved for backward compatibility. Does nothing. Preserved for backward compatibility.
Wunused Wunused
...@@ -387,19 +387,19 @@ falign-loops= ...@@ -387,19 +387,19 @@ falign-loops=
Common RejectNegative Joined UInteger Common RejectNegative Joined UInteger
fargument-alias fargument-alias
Common Common Ignore
Does nothing. Preserved for backward compatibility. Does nothing. Preserved for backward compatibility.
fargument-noalias fargument-noalias
Common Common Ignore
Does nothing. Preserved for backward compatibility. Does nothing. Preserved for backward compatibility.
fargument-noalias-global fargument-noalias-global
Common Common Ignore
Does nothing. Preserved for backward compatibility. Does nothing. Preserved for backward compatibility.
fargument-noalias-anything fargument-noalias-anything
Common Common Ignore
Does nothing. Preserved for backward compatibility. Does nothing. Preserved for backward compatibility.
fasynchronous-unwind-tables fasynchronous-unwind-tables
...@@ -490,7 +490,7 @@ Common Report Var(flag_cse_follow_jumps) Optimization ...@@ -490,7 +490,7 @@ Common Report Var(flag_cse_follow_jumps) Optimization
When running CSE, follow jumps to their targets When running CSE, follow jumps to their targets
fcse-skip-blocks fcse-skip-blocks
Common Common Ignore
Does nothing. Preserved for backward compatibility. Does nothing. Preserved for backward compatibility.
fcx-limited-range fcx-limited-range
...@@ -619,7 +619,7 @@ Common Report Var(flag_float_store) Optimization ...@@ -619,7 +619,7 @@ Common Report Var(flag_float_store) Optimization
Don't allocate floats and doubles in extended-precision registers Don't allocate floats and doubles in extended-precision registers
fforce-addr fforce-addr
Common Common Ignore
Does nothing. Preserved for backward compatibility. Does nothing. Preserved for backward compatibility.
fforward-propagate fforward-propagate
...@@ -852,7 +852,7 @@ Common Report Var(flag_leading_underscore) Init(-1) ...@@ -852,7 +852,7 @@ Common Report Var(flag_leading_underscore) Init(-1)
Give external symbols a leading underscore Give external symbols a leading underscore
floop-optimize floop-optimize
Common Common Ignore
Does nothing. Preserved for backward compatibility. Does nothing. Preserved for backward compatibility.
flto flto
...@@ -1098,7 +1098,7 @@ Common Report Var(flag_rerun_cse_after_loop) Init(2) Optimization ...@@ -1098,7 +1098,7 @@ Common Report Var(flag_rerun_cse_after_loop) Init(2) Optimization
Add a common subexpression elimination pass after loop optimizations Add a common subexpression elimination pass after loop optimizations
frerun-loop-opt frerun-loop-opt
Common Common Ignore
Does nothing. Preserved for backward compatibility. Does nothing. Preserved for backward compatibility.
frounding-math frounding-math
...@@ -1134,7 +1134,7 @@ Common Report Var(flag_sched2_use_superblocks) Optimization ...@@ -1134,7 +1134,7 @@ Common Report Var(flag_sched2_use_superblocks) Optimization
If scheduling post reload, do superblock scheduling If scheduling post reload, do superblock scheduling
fsched2-use-traces fsched2-use-traces
Common Common Ignore
Does nothing. Preserved for backward compatibility. Does nothing. Preserved for backward compatibility.
fschedule-insns fschedule-insns
...@@ -1219,7 +1219,7 @@ Common Report Var(flag_section_anchors) Optimization ...@@ -1219,7 +1219,7 @@ Common Report Var(flag_section_anchors) Optimization
Access data in the same section from shared anchor points Access data in the same section from shared anchor points
fsee fsee
Common Common Ignore
Does nothing. Preserved for backward compatibility. Does nothing. Preserved for backward compatibility.
fzee fzee
...@@ -1286,7 +1286,7 @@ Common RejectNegative Var(flag_stack_usage) ...@@ -1286,7 +1286,7 @@ Common RejectNegative Var(flag_stack_usage)
Output stack usage information on a per-function basis Output stack usage information on a per-function basis
fstrength-reduce fstrength-reduce
Common Common Ignore
Does nothing. Preserved for backward compatibility. Does nothing. Preserved for backward compatibility.
; Nonzero if we should do (language-dependent) alias analysis. ; Nonzero if we should do (language-dependent) alias analysis.
...@@ -1349,7 +1349,7 @@ Common Report Var(flag_tree_bit_ccp) Optimization ...@@ -1349,7 +1349,7 @@ Common Report Var(flag_tree_bit_ccp) Optimization
Enable SSA-BIT-CCP optimization on trees Enable SSA-BIT-CCP optimization on trees
ftree-store-ccp ftree-store-ccp
Common Common Ignore
Does nothing. Preserved for backward compatibility. Does nothing. Preserved for backward compatibility.
ftree-ch ftree-ch
...@@ -1365,7 +1365,7 @@ Common Report Var(flag_tree_copy_prop) Optimization ...@@ -1365,7 +1365,7 @@ Common Report Var(flag_tree_copy_prop) Optimization
Enable copy propagation on trees Enable copy propagation on trees
ftree-store-copy-prop ftree-store-copy-prop
Common Common Ignore
Does nothing. Preserved for backward compatibility. Does nothing. Preserved for backward compatibility.
ftree-cselim ftree-cselim
...@@ -1441,7 +1441,7 @@ Common Report Var(flag_tree_reassoc) Init(1) Optimization ...@@ -1441,7 +1441,7 @@ Common Report Var(flag_tree_reassoc) Init(1) Optimization
Enable reassociation on tree level Enable reassociation on tree level
ftree-salias ftree-salias
Common Common Ignore
Does nothing. Preserved for backward compatibility. Does nothing. Preserved for backward compatibility.
ftree-sink ftree-sink
......
...@@ -555,15 +555,8 @@ extern const char *host_detect_local_cpu (int argc, const char **argv); ...@@ -555,15 +555,8 @@ extern const char *host_detect_local_cpu (int argc, const char **argv);
#ifndef CC1_CPU_SPEC #ifndef CC1_CPU_SPEC
#define CC1_CPU_SPEC_1 "\ #define CC1_CPU_SPEC_1 "\
%{mcpu=*:-mtune=%* \
%n`-mcpu=' is deprecated. Use `-mtune=' or '-march=' instead.\n} \
%<mcpu=* \
%{mintel-syntax:-masm=intel \
%n`-mintel-syntax' is deprecated. Use `-masm=intel' instead.\n} \
%{msse5:-mavx \ %{msse5:-mavx \
%n'-msse5' was removed.\n} \ %n'-msse5' was removed.\n}"
%{mno-intel-syntax:-masm=att \
%n`-mno-intel-syntax' is deprecated. Use `-masm=att' instead.\n}"
#ifndef HAVE_LOCAL_CPU_DETECT #ifndef HAVE_LOCAL_CPU_DETECT
#define CC1_CPU_SPEC CC1_CPU_SPEC_1 #define CC1_CPU_SPEC CC1_CPU_SPEC_1
......
; Options for the IA-32 and AMD64 ports of the compiler. ; Options for the IA-32 and AMD64 ports of the compiler.
; Copyright (C) 2005, 2006, 2007, 2008 Free Software Foundation, Inc. ; Copyright (C) 2005, 2006, 2007, 2008, 2009,
; 2010 Free Software Foundation, Inc.
; ;
; This file is part of GCC. ; This file is part of GCC.
; ;
...@@ -112,6 +113,9 @@ mcmodel= ...@@ -112,6 +113,9 @@ mcmodel=
Target RejectNegative Joined Var(ix86_cmodel_string) Target RejectNegative Joined Var(ix86_cmodel_string)
Use given x86-64 code model Use given x86-64 code model
mcpu=
Target RejectNegative Joined Undocumented Alias(mtune=) Warn(%<-mcpu=%> is deprecated; use %<-mtune=%> or %<-march=%> instead)
mfancy-math-387 mfancy-math-387
Target RejectNegative Report InverseMask(NO_FANCY_MATH_387, USE_FANCY_MATH_387) Save Target RejectNegative Report InverseMask(NO_FANCY_MATH_387, USE_FANCY_MATH_387) Save
Generate sin, cos, sqrt for FPU Generate sin, cos, sqrt for FPU
...@@ -145,7 +149,7 @@ Target Report Mask(INLINE_STRINGOPS_DYNAMICALLY) Save ...@@ -145,7 +149,7 @@ Target Report Mask(INLINE_STRINGOPS_DYNAMICALLY) Save
Inline memset/memcpy string operations, but perform inline version only for small blocks Inline memset/memcpy string operations, but perform inline version only for small blocks
mintel-syntax mintel-syntax
Target Undocumented Target Undocumented Alias(masm=, intel, att) Warn(%<-mintel-syntax%> and %<-mno-intel-syntax%> are deprecated; use %<-masm=intel%> and %<-masm=att%> instead)
;; Deprecated ;; Deprecated
mms-bitfields mms-bitfields
......
...@@ -273,6 +273,19 @@ not need to handle it and no @samp{OPT_} enumeration value is defined ...@@ -273,6 +273,19 @@ not need to handle it and no @samp{OPT_} enumeration value is defined
for it; only the canonical form of the option will be seen in those for it; only the canonical form of the option will be seen in those
places. places.
@item Ignore
This option is ignored apart from printing any warning specified using
@code{Warn}. The option will not be seen by specs and no @samp{OPT_}
enumeration value is defined for it.
@item Warn(@var{message})
If this option is used, output the warning @var{message}.
@var{message} is a format string, either taking a single operand with
a @samp{%qs} format which is the option name, or not taking any
operands, which is passed to the @samp{warning} function. If an alias
is marked @code{Warn}, the target of the alias must not also be marked
@code{Warn}.
@item Report @item Report
The state of the option should be printed by @option{-fverbose-asm}. The state of the option should be printed by @option{-fverbose-asm}.
......
...@@ -114,7 +114,9 @@ function global_state_p(flags) ...@@ -114,7 +114,9 @@ function global_state_p(flags)
# associated with it. # associated with it.
function needs_state_p(flags) function needs_state_p(flags)
{ {
return flag_set_p("Target", flags) return (flag_set_p("Target", flags) \
&& !flag_set_p("Alias.*", flags) \
&& !flag_set_p("Ignore", flags))
} }
# If FLAGS describes an option that needs a static state variable, # If FLAGS describes an option that needs a static state variable,
......
...@@ -201,9 +201,19 @@ for (i = 0; i < n_opts; i++) { ...@@ -201,9 +201,19 @@ for (i = 0; i < n_opts; i++) {
else else
missing_arg_error = quote missing_arg_error quote missing_arg_error = quote missing_arg_error quote
warn_message = opt_args("Warn", flags[i])
if (warn_message == "")
warn_message = "0"
else
warn_message = quote warn_message quote
alias_arg = opt_args("Alias", flags[i]) alias_arg = opt_args("Alias", flags[i])
if (alias_arg == "") { if (alias_arg == "") {
alias_data = "NULL, NULL, N_OPTS" if (flag_set_p("Ignore", flags[i]))
alias_data = "NULL, NULL, OPT_SPECIAL_ignore"
else
alias_data = "NULL, NULL, N_OPTS"
} else { } else {
alias_opt = nth_arg(0, alias_arg) alias_opt = nth_arg(0, alias_arg)
alias_posarg = nth_arg(1, alias_arg) alias_posarg = nth_arg(1, alias_arg)
...@@ -246,8 +256,8 @@ for (i = 0; i < n_opts; i++) { ...@@ -246,8 +256,8 @@ for (i = 0; i < n_opts; i++) {
} }
# Split the printf after %u to work around an ia64-hp-hpux11.23 # Split the printf after %u to work around an ia64-hp-hpux11.23
# awk bug. # awk bug.
printf(" { %c-%s%c,\n %s,\n %s,\n %s, %s, %u,", printf(" { %c-%s%c,\n %s,\n %s,\n %s,\n %s, %s, %u,",
quote, opts[i], quote, hlp, missing_arg_error, quote, opts[i], quote, hlp, missing_arg_error, warn_message,
alias_data, back_chain[i], len) alias_data, back_chain[i], len)
printf(" %d,\n", idx) printf(" %d,\n", idx)
condition = opt_args("Condition", flags[i]) condition = opt_args("Condition", flags[i])
......
...@@ -369,6 +369,7 @@ for (i = 0; i < n_opts; i++) { ...@@ -369,6 +369,7 @@ for (i = 0; i < n_opts; i++) {
print " N_OPTS," print " N_OPTS,"
print " OPT_SPECIAL_unknown," print " OPT_SPECIAL_unknown,"
print " OPT_SPECIAL_ignore,"
print " OPT_SPECIAL_program_name," print " OPT_SPECIAL_program_name,"
print " OPT_SPECIAL_input_file" print " OPT_SPECIAL_input_file"
print "};" print "};"
......
...@@ -214,6 +214,7 @@ decode_cmdline_option (const char **argv, unsigned int lang_mask, ...@@ -214,6 +214,7 @@ decode_cmdline_option (const char **argv, unsigned int lang_mask,
char *p; char *p;
const struct cl_option *option; const struct cl_option *option;
int errors = 0; int errors = 0;
const char *warn_message = NULL;
bool separate_arg_flag; bool separate_arg_flag;
bool joined_arg_flag; bool joined_arg_flag;
...@@ -254,6 +255,8 @@ decode_cmdline_option (const char **argv, unsigned int lang_mask, ...@@ -254,6 +255,8 @@ decode_cmdline_option (const char **argv, unsigned int lang_mask,
goto done; goto done;
} }
warn_message = option->warn_message;
/* Check to see if the option is disabled for this configuration. */ /* Check to see if the option is disabled for this configuration. */
if (option->flags & CL_DISABLED) if (option->flags & CL_DISABLED)
errors |= CL_ERR_DISABLED; errors |= CL_ERR_DISABLED;
...@@ -300,55 +303,73 @@ decode_cmdline_option (const char **argv, unsigned int lang_mask, ...@@ -300,55 +303,73 @@ decode_cmdline_option (const char **argv, unsigned int lang_mask,
if (arg == NULL && (separate_arg_flag || joined_arg_flag)) if (arg == NULL && (separate_arg_flag || joined_arg_flag))
errors |= CL_ERR_MISSING_ARG; errors |= CL_ERR_MISSING_ARG;
/* Is this option an alias? */ /* Is this option an alias (or an ignored option, marked as an alias
of OPT_SPECIAL_ignore)? */
if (option->alias_target != N_OPTS) if (option->alias_target != N_OPTS)
{ {
size_t new_opt_index = option->alias_target; size_t new_opt_index = option->alias_target;
const struct cl_option *new_option = &cl_options[new_opt_index];
/* The new option must not be an alias itself. */
gcc_assert (new_option->alias_target == N_OPTS);
if (option->neg_alias_arg) if (new_opt_index == OPT_SPECIAL_ignore)
{ {
gcc_assert (option->alias_arg != NULL); gcc_assert (option->alias_arg == NULL);
gcc_assert (arg == NULL); gcc_assert (option->neg_alias_arg == NULL);
if (value) opt_index = new_opt_index;
arg = option->alias_arg; arg = NULL;
else
arg = option->neg_alias_arg;
value = 1; value = 1;
} }
else if (option->alias_arg) else
{ {
gcc_assert (value == 1); const struct cl_option *new_option = &cl_options[new_opt_index];
gcc_assert (arg == NULL);
arg = option->alias_arg;
}
opt_index = new_opt_index; /* The new option must not be an alias itself. */
option = new_option; gcc_assert (new_option->alias_target == N_OPTS);
if (value == 0) if (option->neg_alias_arg)
gcc_assert (!(option->flags & CL_REJECT_NEGATIVE)); {
gcc_assert (option->alias_arg != NULL);
gcc_assert (arg == NULL);
if (value)
arg = option->alias_arg;
else
arg = option->neg_alias_arg;
value = 1;
}
else if (option->alias_arg)
{
gcc_assert (value == 1);
gcc_assert (arg == NULL);
arg = option->alias_arg;
}
/* Recompute what arguments are allowed. */ opt_index = new_opt_index;
separate_arg_flag = ((option->flags & CL_SEPARATE) option = new_option;
&& !((option->flags & CL_NO_DRIVER_ARG)
&& (lang_mask & CL_DRIVER)));
joined_arg_flag = (option->flags & CL_JOINED) != 0;
if (!(errors & CL_ERR_MISSING_ARG)) if (value == 0)
{ gcc_assert (!(option->flags & CL_REJECT_NEGATIVE));
if (separate_arg_flag || joined_arg_flag)
gcc_assert (arg != NULL); /* Recompute what arguments are allowed. */
else separate_arg_flag = ((option->flags & CL_SEPARATE)
gcc_assert (arg == NULL); && !((option->flags & CL_NO_DRIVER_ARG)
} && (lang_mask & CL_DRIVER)));
joined_arg_flag = (option->flags & CL_JOINED) != 0;
if (!(errors & CL_ERR_MISSING_ARG))
{
if (separate_arg_flag || joined_arg_flag)
gcc_assert (arg != NULL);
else
gcc_assert (arg == NULL);
}
/* Recheck for disabled options. */ /* Recheck for warnings and disabled options. */
if (option->flags & CL_DISABLED) if (option->warn_message)
errors |= CL_ERR_DISABLED; {
gcc_assert (warn_message == NULL);
warn_message = option->warn_message;
}
if (option->flags & CL_DISABLED)
errors |= CL_ERR_DISABLED;
}
} }
/* Check if this is a switch for a different front end. */ /* Check if this is a switch for a different front end. */
...@@ -370,6 +391,7 @@ decode_cmdline_option (const char **argv, unsigned int lang_mask, ...@@ -370,6 +391,7 @@ decode_cmdline_option (const char **argv, unsigned int lang_mask,
decoded->arg = arg; decoded->arg = arg;
decoded->value = value; decoded->value = value;
decoded->errors = errors; decoded->errors = errors;
decoded->warn_message = warn_message;
if (opt_index == OPT_SPECIAL_unknown) if (opt_index == OPT_SPECIAL_unknown)
{ {
...@@ -408,7 +430,7 @@ decode_cmdline_option (const char **argv, unsigned int lang_mask, ...@@ -408,7 +430,7 @@ decode_cmdline_option (const char **argv, unsigned int lang_mask,
else else
decoded->canonical_option[i] = NULL; decoded->canonical_option[i] = NULL;
} }
if (opt_index != OPT_SPECIAL_unknown) if (opt_index != OPT_SPECIAL_unknown && opt_index != OPT_SPECIAL_ignore)
generate_canonical_option (opt_index, arg, value, decoded); generate_canonical_option (opt_index, arg, value, decoded);
decoded->orig_option_with_args_text = p = XNEWVEC (char, total_len); decoded->orig_option_with_args_text = p = XNEWVEC (char, total_len);
for (i = 0; i < result; i++) for (i = 0; i < result; i++)
...@@ -448,6 +470,7 @@ decode_cmdline_options_to_array (unsigned int argc, const char **argv, ...@@ -448,6 +470,7 @@ decode_cmdline_options_to_array (unsigned int argc, const char **argv,
opt_array = XNEWVEC (struct cl_decoded_option, argc); opt_array = XNEWVEC (struct cl_decoded_option, argc);
opt_array[0].opt_index = OPT_SPECIAL_program_name; opt_array[0].opt_index = OPT_SPECIAL_program_name;
opt_array[0].warn_message = NULL;
opt_array[0].arg = argv[0]; opt_array[0].arg = argv[0];
opt_array[0].orig_option_with_args_text = argv[0]; opt_array[0].orig_option_with_args_text = argv[0];
opt_array[0].canonical_option_num_elements = 1; opt_array[0].canonical_option_num_elements = 1;
...@@ -678,6 +701,7 @@ generate_option (size_t opt_index, const char *arg, int value, ...@@ -678,6 +701,7 @@ generate_option (size_t opt_index, const char *arg, int value,
const struct cl_option *option = &cl_options[opt_index]; const struct cl_option *option = &cl_options[opt_index];
decoded->opt_index = opt_index; decoded->opt_index = opt_index;
decoded->warn_message = NULL;
decoded->arg = arg; decoded->arg = arg;
decoded->value = value; decoded->value = value;
decoded->errors = (option_ok_for_language (option, lang_mask) decoded->errors = (option_ok_for_language (option, lang_mask)
...@@ -709,6 +733,7 @@ generate_option_input_file (const char *file, ...@@ -709,6 +733,7 @@ generate_option_input_file (const char *file,
struct cl_decoded_option *decoded) struct cl_decoded_option *decoded)
{ {
decoded->opt_index = OPT_SPECIAL_input_file; decoded->opt_index = OPT_SPECIAL_input_file;
decoded->warn_message = NULL;
decoded->arg = file; decoded->arg = file;
decoded->orig_option_with_args_text = file; decoded->orig_option_with_args_text = file;
decoded->canonical_option_num_elements = 1; decoded->canonical_option_num_elements = 1;
...@@ -729,7 +754,10 @@ read_cmdline_option (struct cl_decoded_option *decoded, ...@@ -729,7 +754,10 @@ read_cmdline_option (struct cl_decoded_option *decoded,
const struct cl_option_handlers *handlers) const struct cl_option_handlers *handlers)
{ {
const struct cl_option *option; const struct cl_option *option;
const char *opt; const char *opt = decoded->orig_option_with_args_text;
if (decoded->warn_message)
warning (0, decoded->warn_message, opt);
if (decoded->opt_index == OPT_SPECIAL_unknown) if (decoded->opt_index == OPT_SPECIAL_unknown)
{ {
...@@ -738,8 +766,10 @@ read_cmdline_option (struct cl_decoded_option *decoded, ...@@ -738,8 +766,10 @@ read_cmdline_option (struct cl_decoded_option *decoded,
return; return;
} }
if (decoded->opt_index == OPT_SPECIAL_ignore)
return;
option = &cl_options[decoded->opt_index]; option = &cl_options[decoded->opt_index];
opt = decoded->orig_option_with_args_text;
if (decoded->errors & CL_ERR_DISABLED) if (decoded->errors & CL_ERR_DISABLED)
{ {
......
...@@ -2081,24 +2081,6 @@ common_handle_option (const struct cl_decoded_option *decoded, ...@@ -2081,24 +2081,6 @@ common_handle_option (const struct cl_decoded_option *decoded,
global_dc->inhibit_warnings = true; global_dc->inhibit_warnings = true;
break; break;
case OPT_fsee:
case OPT_fcse_skip_blocks:
case OPT_floop_optimize:
case OPT_frerun_loop_opt:
case OPT_fsched2_use_traces:
case OPT_fstrength_reduce:
case OPT_ftree_store_copy_prop:
case OPT_fforce_addr:
case OPT_ftree_salias:
case OPT_ftree_store_ccp:
case OPT_Wunreachable_code:
case OPT_fargument_alias:
case OPT_fargument_noalias:
case OPT_fargument_noalias_anything:
case OPT_fargument_noalias_global:
/* These are no-ops, preserved for backward compatibility. */
break;
case OPT_fuse_linker_plugin: case OPT_fuse_linker_plugin:
/* No-op. Used by the driver and passed to us because it starts with f.*/ /* No-op. Used by the driver and passed to us because it starts with f.*/
break; break;
...@@ -2363,6 +2345,8 @@ enable_warning_as_error (const char *arg, int value, unsigned int lang_mask, ...@@ -2363,6 +2345,8 @@ enable_warning_as_error (const char *arg, int value, unsigned int lang_mask,
if (option->alias_target != N_OPTS) if (option->alias_target != N_OPTS)
option_index = option->alias_target; option_index = option->alias_target;
if (option_index == OPT_SPECIAL_ignore)
return;
diagnostic_classify_diagnostic (global_dc, option_index, kind, diagnostic_classify_diagnostic (global_dc, option_index, kind,
UNKNOWN_LOCATION); UNKNOWN_LOCATION);
if (kind == DK_ERROR) if (kind == DK_ERROR)
......
...@@ -45,6 +45,7 @@ struct cl_option ...@@ -45,6 +45,7 @@ struct cl_option
const char *opt_text; const char *opt_text;
const char *help; const char *help;
const char *missing_argument_error; const char *missing_argument_error;
const char *warn_message;
const char *alias_arg; const char *alias_arg;
const char *neg_alias_arg; const char *neg_alias_arg;
unsigned short alias_target; unsigned short alias_target;
...@@ -117,6 +118,9 @@ struct cl_decoded_option ...@@ -117,6 +118,9 @@ struct cl_decoded_option
non-options and unknown options. */ non-options and unknown options. */
size_t opt_index; size_t opt_index;
/* Any warning to give for use of this option, or NULL if none. */
const char *warn_message;
/* The string argument, or NULL if none. For OPT_SPECIAL_* cases, /* The string argument, or NULL if none. For OPT_SPECIAL_* cases,
the option or non-option command-line argument. */ the option or non-option command-line argument. */
const char *arg; const char *arg;
......
2010-09-02 Joseph Myers <joseph@codesourcery.com>
* exgettext: Handle {} in operand of MissingArgError. Handle
Warn.
2010-07-27 Joseph Myers <joseph@codesourcery.com> 2010-07-27 Joseph Myers <joseph@codesourcery.com>
* exgettext: Also extract MissingArgError texts from .opt files. * exgettext: Also extract MissingArgError texts from .opt files.
......
...@@ -226,7 +226,22 @@ echo "scanning option files..." >&2 ...@@ -226,7 +226,22 @@ echo "scanning option files..." >&2
if ((field == 1) && /MissingArgError/) { if ((field == 1) && /MissingArgError/) {
line = $0 line = $0
sub(".*MissingArgError\\(", "", line) sub(".*MissingArgError\\(", "", line)
sub("\\).*", "", line) if (line ~ "^{") {
sub("^{", "", line)
sub("}\\).*", "", line)
} else
sub("\\).*", "", line)
printf("#line %d \"%s\"\n", lineno, file)
printf("_(\"%s\")\n", line)
}
if ((field == 1) && /Warn/) {
line = $0
sub(".*Warn\\(", "", line)
if (line ~ "^{") {
sub("^{", "", line)
sub("}\\).*", "", line)
} else
sub("\\).*", "", line)
printf("#line %d \"%s\"\n", lineno, file) printf("#line %d \"%s\"\n", lineno, file)
printf("_(\"%s\")\n", line) printf("_(\"%s\")\n", line)
} }
......
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