This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

RFA: .opt files for x86, darwin and lynxos


This patch makes the i386 port define its options using .opt files.
Some of the options come from config/ (config/darwin.h and config/lynxos.h),
so this patch makes those OSes use .opt files too.

config/darwin.h and config/lynxos.h are also used by powerpc targets.
It's possible to mix options defined by .opt files with options defined
in the traditional way, so there's no need to do a full powerpc conversion
at the same time.  All we need to do is add the config/*.opt files to
$extra_options in config.gcc.

Main points:

  - I wondered about doing more parsing in ix86_handle_option (and
    implemented that way at first).  But many of the validity checks
    are dependent on other option states like TARGET_64BIT and flag_pic.

  - The -malign-* options were slated for removal in 3.2 but that hasn't
    happened yet.  I haven't removed them here because IMO it should be
    handled as a separate patch (with associated docs changes, etc.).

  - I renamed MASK_NO_ALIGN_STROPS to MASK_NO_ALIGN_STRINGOPS and
    MASK_INLINE_ALL_STROPS to MASK_INLINE_ALL_STRINGOPS.  This makes
    the MASK_* name match the TARGET_* name.  I grepped the tree for
    references to the old mask names, but other than the TARGET_*
    definitions themselves, there were none.

  - I kept TARGET_FLOAT_RETURNS_IN_387, making it an alias for
    TARGET_FLOAT_RETURNS.  Both MASK_FLOAT_RETURNS and
    TARGET_FLOAT_RETURNS_IN_387 are used in several places and
    this patch is invasive enough as it is.

  - There are various MASK_NO_* masks.  I've kept them here and
    used the construct:

        mno-foo
        Target RejectNegative Mask(NO_FOO) Undocumented

        mfoo
        Target RejectNegative InverseMask(NO_FOO, ...)
        ...

    I've left the "no-" form undocumented so that they aren't listed in
    the --help output.  None of the no- options for the normal options
    are listed and it seemed strange to list these based entirely on
    their internal representation.

  - i386.h provides undocumented -mwindows and -mdll options.
    I've put these in their own file (dummy-windows.opt) so that
    cygwin and mingw can provide properly-documented versions.

Bootstrapped & regression tested on i686-pc-linux-gnu.  Also tested
by building cc1 for:

    i386-aout
    i386-cygwin
    i386-darwin
    i386-elf
    i386-interix3
    i386-lynxos
    i386-mingw32
    i386-pc-msdosdjgpp
    i386-sco3.2v5
    i386-solaris2
    powerpc-darwin
    powerpc-lynxos
    x86_64-linux-gnu

and checking the options by hand.  I also tried i386-uwin, but it
didn't build because no target makefile fragment provides a build
rule for winnt.o.

OK to install?

Richard


	* config.gcc (*-*-darwin*): Add darwin.opt to $extra_options.
	(i[34567]86-pc-msdosdjgpp*): Likewise i386/djgpp.opt.
	(i[34567]86-*-lynxos*, powerpc-*-lynxos*): Likewise lynx.opt.
	(i[34567]86-*-sco3.2v5*): Likewise i386/sco5.opt.
	(i[34567]86-*-pe, i[34567]86-*-cygwin*, i[34567]86-*-mingw32*)
	(i[34567]86-*-uwin*): Likewise i386/cygming.opt.
	Add i386/dummy-windows.opt if the target uses i386/i386.opt but
	not i386/cygming.opt.
	* config/darwin.h (darwin_one_byte_bool, darwin_fix_and_continue)
	(darwin_fix_and_continue_switch, SUBTARGET_OPTIONS): Delete.
	* config/darwin.c (darwin_one_byte_bool, darwin_fix_and_continue)
	(darwin_fix_and_continue_switch): Delete.
	* config/lynx.h (SUBTARGET_OS_LYNX_SWITCHES): Delete.
	(SUBTARGET_SWITCHES): Delete.
	* config/i386/i386.h (target_flags, MASK_80387, MASK_RTD)
	(MASK_ALIGN_DOUBLE, MASK_SVR3_SHLIB, MASK_IEEE_FP, MASK_FLOAT_RETURNS)
	(MASK_NO_FANCY_MATH_387, MASK_OMIT_LEAF_FRAME_POINTER)
	(MASK_STACK_PROBE, MASK_NO_ALIGN_STROPS, MASK_INLINE_ALL_STROPS)
	(MASK_NO_PUSH_ARGS, MASK_ACCUMULATE_OUTGOING_ARGS, MASK_MMX)
	(MASK_SSE, MASK_SSE2, MASK_SSE3, MASK_3DNOW, MASK_3DNOW_A)
	(MASK_128BIT_LONG_DOUBLE, MASK_64BIT, MASK_MS_BITFIELD_LAYOUT)
	(MASK_TLS_DIRECT_SEG_REFS, MASK_NO_RED_ZONE, TARGET_80387)
	(TARGET_RTD, TARGET_ALIGN_DOUBLE, TARGET_PUSH_ARGS)
	(TARGET_ACCUMULATE_OUTGOING_ARGS, TARGET_SVR3_SHLIB, TARGET_IEEE_FP)
	(TARGET_128BIT_LONG_DOUBLE, TARGET_NO_FANCY_MATH_387)
	(TARGET_USE_FANCY_MATH_387, TARGET_OMIT_LEAF_FRAME_POINTER)
	(TARGET_DEBUG_ADDR, TARGET_DEBUG_ARG): Delete.
	(TARGET_FLOAT_RETURNS_IN_80387): Make an alias of TARGET_FLOAT_RETURNS.
	(TARGET_64BIT): Undef before redefining.
	(TARGET_TLS_DIRECT_SEG_REFS, TARGET_STACK_PROBE)
	(TARGET_ALIGN_STRINGOPS, TARGET_INLINE_ALL_STRINGOPS, TARGET_SSE)
	(TARGET_SSE2, TARGET_SSE3, TARGET_MMX, TARGET_3DNOW, TARGET_3DNOW_A)
	(TARGET_RED_ZONE, TARGET_USE_MS_BITFIELD_LAYOUT, TARGET_SWITCHES)
	(TARGET_OPTIONS, SUBTARGET_SWITCHES, SUBTARGET_OPTIONS)
	(ix86_fpmath_string, ix86_tls_dialect_string, ix86_cmodel_string)
	(ix86_asm_string, ix86_regparm, ix86_regparm_string)
	(ix86_preferred_stack_boundary_string, ix86_branch_cost_string)
	(ix86_debug_arg_string, ix86_debug_addr_string)
	(ix86_align_loops_string, ix86_align_jumps_string)
	(ix86_align_funcs_string): Delete.
	* config/i386/cygming.h (MASK_NOP_FUN_DLLIMPORT)
	(TARGET_NOP_FUN_DLLIMPORT, SUBTARGET_SWITCHES): Delete.
	* config/i386/djgpp.h (MASK_BNU210, SUBTARGET_SWITCHES): Delete.
	(SUBTARGET_OVERRIDE_OPTIONS): Check TARGET_BNU210.
	* config/i386/lynx.h (SUBTARGET_SWITCHES): Delete.
	* config/i386/sco5.h (MASK_COFF, TARGET_ELF)
	(SUBTARGET_SWITCHES): Delete.
	* config/i386/i386.c (ix86_debug_arg_string): Delete.
	(ix86_debug_addr_string): Delete.
	(ix86_cmodel_string, ix86_asm_string, ix86_tls_dialect_string)
	(ix86_fpmath_string, ix86_regparm_string, ix86_regparm)
	(ix86_align_loops_string, ix86_align_jumps_string)
	(ix86_preferred_stack_boundary_string, ix86_branch_cost_string)
	(ix86_align_funcs_string): Make static.
	(TARGET_DEFAULT_TARGET_FLAGS, TARGET_HANDLE_OPTION): Override defaults.
	(ix86_handle_option): New function.
	(TARGET_USE_MS_BITFIELD_LAYOUT): Delete.
	(ix86_ms_bitfield_layout_p): Check TARGET_MS_BITFIELD_LAYOUT.
	* config/rs6000/darwin.h (SUBTARGET_OVERRIDE_OPTIONS): Remove handling
	of darwin_fix_and_continue_switch.
	(darwin_one_byte_bool): Delete.
	* config/rs6000/lynx.h (EXTRA_SUBTARGET_SWITCHES): Delete.
	* config/rs6000/rs6000.c (rs6000_override_options): Update assignment
	to darwin_one_byte_bool.
	* config/darwin.opt, config/lynx.opt, config/i386/cygming.opt,
	* config/i386/djgpp.opt, config/i386/dummy-windows.opt,
	* config/i386/i386.opt, config/i386/sco5.opt: New files.

Index: config.gcc
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config.gcc,v
retrieving revision 1.534
diff -u -p -F^\([(a-zA-Z0-9_]\|#define\) -r1.534 config.gcc
--- config.gcc	18 Apr 2005 10:59:35 -0000	1.534
+++ config.gcc	20 Apr 2005 20:30:07 -0000
@@ -363,6 +363,7 @@ case ${target} in
   tm_p_file="${tm_p_file} darwin-protos.h"
   tmake_file="t-darwin t-slibgcc-darwin"
   target_gtfiles="\$(srcdir)/config/darwin.c"
+  extra_options="${extra_options} darwin.opt"
   c_target_objs="darwin-c.o"
   cxx_target_objs="darwin-c.o"
   extra_parts="crt2.o"
@@ -1010,6 +1011,7 @@ i[34567]86-pc-msdosdjgpp*)
 	xm_file=i386/xm-djgpp.h
 	tm_file="dbxcoff.h ${tm_file} i386/unix.h i386/bsd.h i386/gas.h i386/djgpp.h"
 	tmake_file=i386/t-djgpp
+	extra_options="${extra_options} i386/djgpp.opt"
 	gnu_ld=yes
 	gas=yes
 	;;
@@ -1018,6 +1020,7 @@ i[34567]86-*-lynxos*)
 	tm_file="${tm_file} i386/unix.h i386/att.h dbxelf.h elfos.h i386/lynx.h lynx.h"
 	tmake_file="i386/t-crtstuff t-lynx"
 	extra_parts="crtbegin.o crtbeginS.o crtend.o crtendS.o"
+	extra_options="${extra_options} lynx.opt"
 	thread_file=lynx
 	gnu_ld=yes
 	gas=yes
@@ -1060,6 +1063,7 @@ i[34567]86-*-sco3.2v5*)	# 80386 running 
 	fi
 	tmake_file=i386/t-sco5
 	extra_parts="crtbegin.o crtend.o"
+	extra_options="${extra_options} i386/sco5.opt"
 	use_fixproto=yes
 	;;
 i[34567]86-*-solaris2*)
@@ -1149,6 +1153,7 @@ i[34567]86-*-pe | i[34567]86-*-cygwin*)
 	xm_file=i386/xm-cygwin.h
 	tmake_file="i386/t-cygwin i386/t-cygming"
 	target_gtfiles="\$(srcdir)/config/i386/winnt.c"
+	extra_options="${extra_options} i386/cygming.opt"
 	extra_objs=winnt.o
 	c_target_objs=cygwin2.o
 	cxx_target_objs=cygwin2.o
@@ -1162,6 +1167,7 @@ i[34567]86-*-mingw32*)
 	xm_file=i386/xm-mingw32.h
 	tmake_file="i386/t-cygming i386/t-mingw32"
 	target_gtfiles="\$(srcdir)/config/i386/winnt.c"
+	extra_options="${extra_options} i386/cygming.opt"
 	extra_objs=winnt.o
 	case ${enable_threads} in
 	  "" | yes | win32) thread_file='win32' ;;
@@ -1178,6 +1184,7 @@ i[34567]86-*-uwin*)
 	tm_file="${tm_file} i386/unix.h i386/bsd.h i386/gas.h dbxcoff.h i386/cygwin.h i386/uwin.h"
 	tmake_file="i386/t-cygwin i386/t-uwin"
 	extra_objs=winnt.o
+	extra_options="${extra_options} i386/cygming.opt"
 	target_gtfiles="\$(srcdir)/config/i386/winnt.c"
 	if test x$enable_threads = xyes; then
 		thread_file='win32'
@@ -1689,6 +1696,7 @@ powerpc-*-lynxos*)
 	tm_file="${tm_file} dbxelf.h elfos.h rs6000/sysv4.h rs6000/lynx.h lynx.h"
 	tmake_file="t-lynx rs6000/t-lynx"
 	extra_parts="crtbegin.o crtbeginS.o crtend.o crtendS.o"
+	extra_options="${extra_options} lynx.opt"
 	thread_file=lynx
 	gnu_ld=yes
 	gas=yes
@@ -2236,6 +2244,14 @@ i[34567]86-*-* | x86_64-*-*)
 	;;
 esac
 
+case $extra_options in
+  *i386/cygming.opt*)
+    ;;
+  *i386/i386.opt*)
+    extra_options="$extra_options i386/dummy-windows.opt"
+    ;;
+esac
+
 # Support for --with-cpu and related options (and a few unrelated options,
 # too).
 case ${with_cpu} in
Index: config/darwin.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/darwin.h,v
retrieving revision 1.114
diff -u -p -F^\([(a-zA-Z0-9_]\|#define\) -r1.114 darwin.h
--- config/darwin.h	31 Mar 2005 14:59:55 -0000	1.114
+++ config/darwin.h	20 Apr 2005 20:30:08 -0000
@@ -140,24 +140,6 @@ #define TARGET_OPTION_TRANSLATE_TABLE \
   { "-unexported_symbols_list", "-Zunexported_symbols_list" }, \
   SUBTARGET_OPTION_TRANSLATE_TABLE
 
-/* Nonzero if the user has chosen to force sizeof(bool) to be 1
-   by providing the -mone-byte-bool switch.  It would be better
-   to use SUBTARGET_SWITCHES for this instead of SUBTARGET_OPTIONS,
-   but there are no more bits in rs6000 TARGET_SWITCHES.  Note
-   that this switch has no "no-" variant. */
-extern const char *darwin_one_byte_bool;
-  
-extern int darwin_fix_and_continue;
-extern const char *darwin_fix_and_continue_switch;
-
-#undef SUBTARGET_OPTIONS
-#define SUBTARGET_OPTIONS \
-  {"one-byte-bool", &darwin_one_byte_bool, N_("Set sizeof(bool) to 1"), 0 }, \
-  {"fix-and-continue", &darwin_fix_and_continue_switch,			\
-   N_("Generate code suitable for fast turn around debugging"), 0},	\
-  {"no-fix-and-continue", &darwin_fix_and_continue_switch,		\
-   N_("Don't generate code suitable for fast turn around debugging"), 0}
-
 /* These compiler options take n arguments.  */
 
 #undef  WORD_SWITCH_TAKES_ARG
Index: config/darwin.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/darwin.c,v
retrieving revision 1.111
diff -u -p -F^\([(a-zA-Z0-9_]\|#define\) -r1.111 darwin.c
--- config/darwin.c	8 Apr 2005 23:30:16 -0000	1.111
+++ config/darwin.c	20 Apr 2005 20:30:08 -0000
@@ -77,10 +77,6 @@ Boston, MA 02111-1307, USA.  */
    the code that handles @code{static} data indirection.  */
 
 
-/* Nonzero if the user passes the -mone-byte-bool switch, which forces
-   sizeof(bool) to be 1. */
-const char *darwin_one_byte_bool = 0;
-
 int
 name_needs_quotes (const char *name)
 {
@@ -1397,13 +1393,4 @@ darwin_file_end (void)
   fprintf (asm_out_file, "\t.subsections_via_symbols\n");
 }
 
-/* True, iff we're generating fast turn around debugging code.  When
-   true, we arrange for function prologues to start with 4 nops so
-   that gdb may insert code to redirect them, and for data to accessed
-   indirectly.  The runtime uses this indirection to forward
-   references for data to the original instance of that data.  */
-
-int darwin_fix_and_continue;
-const char *darwin_fix_and_continue_switch;
-
 #include "gt-darwin.h"
Index: config/lynx.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/lynx.h,v
retrieving revision 1.15
diff -u -p -F^\([(a-zA-Z0-9_]\|#define\) -r1.15 lynx.h
--- config/lynx.h	5 Aug 2004 04:55:35 -0000	1.15
+++ config/lynx.h	20 Apr 2005 20:30:08 -0000
@@ -129,20 +129,6 @@ Boston, MA 02111-1307, USA.  */
  %{mthreads: thread/crtn.o%s} %{!mthreads: crtn.o%s}"
 #endif
 
-/* Because of the %{m*} in cc1_options these options get substituted
-   for cc1.  We ignore them here.  */
-
-#ifndef SUBTARGET_OS_LYNX_SWITCHES
-# define SUBTARGET_OS_LYNX_SWITCHES				\
-  { "shared",		0, N_("Use shared libraries") },	\
-  { "threads", 		0, N_("Support multi-threading") },	\
-  { "legacy-threads",	0, N_("Support legacy multi-threading") },
-#endif
-
-#ifndef SUBTARGET_SWITCHES
-# define SUBTARGET_SWITCHES SUBTARGET_OS_LYNX_SWITCHES
-#endif
-
 /* Define the actual types of some ANSI-mandated types.  */
 
 #ifndef SIZE_TYPE
Index: config/i386/i386.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/i386/i386.h,v
retrieving revision 1.428
diff -u -p -F^\([(a-zA-Z0-9_]\|#define\) -r1.428 i386.h
--- config/i386/i386.h	14 Apr 2005 23:42:45 -0000	1.428
+++ config/i386/i386.h	20 Apr 2005 20:30:09 -0000
@@ -88,10 +88,6 @@ struct processor_costs {
 
 extern const struct processor_costs *ix86_cost;
 
-/* Run-time compilation parameters selecting different hardware subsets.  */
-
-extern int target_flags;
-
 /* Macros used in the machine description to test the flags.  */
 
 /* configure can arrange to make this 2, to force a 486.  */
@@ -109,104 +105,20 @@ #define TARGET_FPMATH_DEFAULT \
   (TARGET_64BIT && TARGET_SSE ? FPMATH_SSE : FPMATH_387)
 #endif
 
-/* Masks for the -m switches */
-#define MASK_80387		0x00000001	/* Hardware floating point */
-#define MASK_RTD		0x00000002	/* Use ret that pops args */
-#define MASK_ALIGN_DOUBLE	0x00000004	/* align doubles to 2 word boundary */
-#define MASK_SVR3_SHLIB		0x00000008	/* Uninit locals into bss */
-#define MASK_IEEE_FP		0x00000010	/* IEEE fp comparisons */
-#define MASK_FLOAT_RETURNS	0x00000020	/* Return float in st(0) */
-#define MASK_NO_FANCY_MATH_387	0x00000040	/* Disable sin, cos, sqrt */
-#define MASK_OMIT_LEAF_FRAME_POINTER 0x080      /* omit leaf frame pointers */
-#define MASK_STACK_PROBE	0x00000100	/* Enable stack probing */
-#define MASK_NO_ALIGN_STROPS	0x00000200	/* Enable aligning of string ops.  */
-#define MASK_INLINE_ALL_STROPS	0x00000400	/* Inline stringops in all cases */
-#define MASK_NO_PUSH_ARGS	0x00000800	/* Use push instructions */
-#define MASK_ACCUMULATE_OUTGOING_ARGS 0x00001000/* Accumulate outgoing args */
-#define MASK_MMX		0x00002000	/* Support MMX regs/builtins */
-#define MASK_SSE		0x00004000	/* Support SSE regs/builtins */
-#define MASK_SSE2		0x00008000	/* Support SSE2 regs/builtins */
-#define MASK_SSE3		0x00010000	/* Support SSE3 regs/builtins */
-#define MASK_3DNOW		0x00020000	/* Support 3Dnow builtins */
-#define MASK_3DNOW_A		0x00040000	/* Support Athlon 3Dnow builtins */
-#define MASK_128BIT_LONG_DOUBLE 0x00080000	/* long double size is 128bit */
-#define MASK_64BIT		0x00100000	/* Produce 64bit code */
-#define MASK_MS_BITFIELD_LAYOUT 0x00200000	/* Use native (MS) bitfield layout */
-#define MASK_TLS_DIRECT_SEG_REFS 0x00400000	/* Avoid adding %gs:0  */
-
-/* Unused:			0x03e0000	*/
-
-/* ... overlap with subtarget options starts by 0x04000000.  */
-#define MASK_NO_RED_ZONE	0x04000000	/* Do not use red zone */
-
-/* Use the floating point instructions */
-#define TARGET_80387 (target_flags & MASK_80387)
-
-/* Compile using ret insn that pops args.
-   This will not work unless you use prototypes at least
-   for all functions that can take varying numbers of args.  */
-#define TARGET_RTD (target_flags & MASK_RTD)
-
-/* Align doubles to a two word boundary.  This breaks compatibility with
-   the published ABI's for structures containing doubles, but produces
-   faster code on the pentium.  */
-#define TARGET_ALIGN_DOUBLE (target_flags & MASK_ALIGN_DOUBLE)
-
-/* Use push instructions to save outgoing args.  */
-#define TARGET_PUSH_ARGS (!(target_flags & MASK_NO_PUSH_ARGS))
-
-/* Accumulate stack adjustments to prologue/epilogue.  */
-#define TARGET_ACCUMULATE_OUTGOING_ARGS \
- (target_flags & MASK_ACCUMULATE_OUTGOING_ARGS)
-
-/* Put uninitialized locals into bss, not data.
-   Meaningful only on svr3.  */
-#define TARGET_SVR3_SHLIB (target_flags & MASK_SVR3_SHLIB)
-
-/* Use IEEE floating point comparisons.  These handle correctly the cases
-   where the result of a comparison is unordered.  Normally SIGFPE is
-   generated in such cases, in which case this isn't needed.  */
-#define TARGET_IEEE_FP (target_flags & MASK_IEEE_FP)
-
-/* Functions that return a floating point value may return that value
-   in the 387 FPU or in 386 integer registers.  If set, this flag causes
-   the 387 to be used, which is compatible with most calling conventions.  */
-#define TARGET_FLOAT_RETURNS_IN_80387 (target_flags & MASK_FLOAT_RETURNS)
-
-/* Long double is 128bit instead of 96bit, even when only 80bits are used.
-   This mode wastes cache, but avoid misaligned data accesses and simplifies
-   address calculations.  */
-#define TARGET_128BIT_LONG_DOUBLE (target_flags & MASK_128BIT_LONG_DOUBLE)
-
-/* Disable generation of FP sin, cos and sqrt operations for 387.
-   This is because FreeBSD lacks these in the math-emulator-code */
-#define TARGET_NO_FANCY_MATH_387 (target_flags & MASK_NO_FANCY_MATH_387)
-
-/* Generate 387 floating point intrinsics for the current target.  */
-#define TARGET_USE_FANCY_MATH_387 (! TARGET_NO_FANCY_MATH_387)
-
-/* Don't create frame pointers for leaf functions */
-#define TARGET_OMIT_LEAF_FRAME_POINTER \
-  (target_flags & MASK_OMIT_LEAF_FRAME_POINTER)
-
-/* Debug GO_IF_LEGITIMATE_ADDRESS */
-#define TARGET_DEBUG_ADDR (ix86_debug_addr_string != 0)
-
-/* Debug FUNCTION_ARG macros */
-#define TARGET_DEBUG_ARG (ix86_debug_arg_string != 0)
+#define TARGET_FLOAT_RETURNS_IN_80387 TARGET_FLOAT_RETURNS
 
 /* 64bit Sledgehammer mode.  For libgcc2 we make sure this is a
    compile-time constant.  */
 #ifdef IN_LIBGCC2
+#undef TARGET_64BIT
 #ifdef __x86_64__
 #define TARGET_64BIT 1
 #else
 #define TARGET_64BIT 0
 #endif
 #else
-#ifdef TARGET_BI_ARCH
-#define TARGET_64BIT (target_flags & MASK_64BIT)
-#else
+#ifndef TARGET_BI_ARCH
+#undef TARGET_64BIT
 #if TARGET_64BIT_DEFAULT
 #define TARGET_64BIT 1
 #else
@@ -218,9 +130,6 @@ #define TARGET_64BIT 0
 #define HAS_LONG_COND_BRANCH 1
 #define HAS_LONG_UNCOND_BRANCH 1
 
-/* Avoid adding %gs:0 in TLS references; use %gs:address directly.  */
-#define TARGET_TLS_DIRECT_SEG_REFS (target_flags & MASK_TLS_DIRECT_SEG_REFS)
-
 #define TARGET_386 (ix86_tune == PROCESSOR_I386)
 #define TARGET_486 (ix86_tune == PROCESSOR_I486)
 #define TARGET_PENTIUM (ix86_tune == PROCESSOR_PENTIUM)
@@ -310,26 +219,11 @@ #define TARGET_FOUR_JUMP_LIMIT (x86_four
 #define TARGET_SCHEDULE (x86_schedule & TUNEMASK)
 #define TARGET_USE_BT (x86_use_bt & TUNEMASK)
 
-#define TARGET_STACK_PROBE (target_flags & MASK_STACK_PROBE)
-
-#define TARGET_ALIGN_STRINGOPS (!(target_flags & MASK_NO_ALIGN_STROPS))
-#define TARGET_INLINE_ALL_STRINGOPS (target_flags & MASK_INLINE_ALL_STROPS)
-
 #define ASSEMBLER_DIALECT (ix86_asm_dialect)
 
-#define TARGET_SSE ((target_flags & MASK_SSE) != 0)
-#define TARGET_SSE2 ((target_flags & MASK_SSE2) != 0)
-#define TARGET_SSE3 ((target_flags & MASK_SSE3) != 0)
 #define TARGET_SSE_MATH ((ix86_fpmath & FPMATH_SSE) != 0)
 #define TARGET_MIX_SSE_I387 ((ix86_fpmath & FPMATH_SSE) \
 			     && (ix86_fpmath & FPMATH_387))
-#define TARGET_MMX ((target_flags & MASK_MMX) != 0)
-#define TARGET_3DNOW ((target_flags & MASK_3DNOW) != 0)
-#define TARGET_3DNOW_A ((target_flags & MASK_3DNOW_A) != 0)
-
-#define TARGET_RED_ZONE (!(target_flags & MASK_NO_RED_ZONE))
-
-#define TARGET_USE_MS_BITFIELD_LAYOUT  (target_flags & MASK_MS_BITFIELD_LAYOUT)
 
 #define TARGET_GNU_TLS (ix86_tls_dialect == TLS_DIALECT_GNU)
 #define TARGET_SUN_TLS (ix86_tls_dialect == TLS_DIALECT_SUN)
@@ -337,116 +231,6 @@ #define TARGET_SUN_TLS (ix86_tls_dialect
 #define TARGET_CMPXCHG (x86_cmpxchg & (1 << ix86_arch))
 #define TARGET_XADD (x86_xadd & (1 << ix86_arch))
 
-/* WARNING: Do not mark empty strings for translation, as calling
-            gettext on an empty string does NOT return an empty
-            string.  */
-
-
-#define TARGET_SWITCHES							      \
-{ { "80387",			 MASK_80387, N_("Use hardware fp") },	      \
-  { "no-80387",			-MASK_80387, N_("Do not use hardware fp") },  \
-  { "hard-float",		 MASK_80387, N_("Use hardware fp") },	      \
-  { "soft-float",		-MASK_80387, N_("Do not use hardware fp") },  \
-  { "no-soft-float",		 MASK_80387, N_("Use hardware fp") },	      \
-  { "386",			 0, "" /*Deprecated.*/},		      \
-  { "486",			 0, "" /*Deprecated.*/},		      \
-  { "pentium",			 0, "" /*Deprecated.*/},		      \
-  { "pentiumpro",		 0, "" /*Deprecated.*/},		      \
-  { "intel-syntax",		 0, "" /*Deprecated.*/},	 	      \
-  { "no-intel-syntax",		 0, "" /*Deprecated.*/},	 	      \
-  { "rtd",			 MASK_RTD,				      \
-    N_("Alternate calling convention") },				      \
-  { "no-rtd",			-MASK_RTD,				      \
-    N_("Use normal calling convention") },				      \
-  { "align-double",		 MASK_ALIGN_DOUBLE,			      \
-    N_("Align some doubles on dword boundary") },			      \
-  { "no-align-double",		-MASK_ALIGN_DOUBLE,			      \
-    N_("Align doubles on word boundary") },				      \
-  { "svr3-shlib",		 MASK_SVR3_SHLIB,			      \
-    N_("Uninitialized locals in .bss")  },				      \
-  { "no-svr3-shlib",		-MASK_SVR3_SHLIB,			      \
-    N_("Uninitialized locals in .data") },				      \
-  { "ieee-fp",			 MASK_IEEE_FP,				      \
-    N_("Use IEEE math for fp comparisons") },				      \
-  { "no-ieee-fp",		-MASK_IEEE_FP,				      \
-    N_("Do not use IEEE math for fp comparisons") },			      \
-  { "fp-ret-in-387",		 MASK_FLOAT_RETURNS,			      \
-    N_("Return values of functions in FPU registers") },		      \
-  { "no-fp-ret-in-387",		-MASK_FLOAT_RETURNS ,			      \
-    N_("Do not return values of functions in FPU registers")},		      \
-  { "no-fancy-math-387",	 MASK_NO_FANCY_MATH_387,		      \
-    N_("Do not generate sin, cos, sqrt for FPU") },			      \
-  { "fancy-math-387",		-MASK_NO_FANCY_MATH_387,		      \
-     N_("Generate sin, cos, sqrt for FPU")},				      \
-  { "omit-leaf-frame-pointer",	 MASK_OMIT_LEAF_FRAME_POINTER,		      \
-    N_("Omit the frame pointer in leaf functions") },			      \
-  { "no-omit-leaf-frame-pointer",-MASK_OMIT_LEAF_FRAME_POINTER, "" },	      \
-  { "stack-arg-probe",		 MASK_STACK_PROBE,			      \
-    N_("Enable stack probing") },					      \
-  { "no-stack-arg-probe",	-MASK_STACK_PROBE, "" },		      \
-  { "windows",			0, 0 /* undocumented */ },		      \
-  { "dll",			0,  0 /* undocumented */ },		      \
-  { "align-stringops",		-MASK_NO_ALIGN_STROPS,			      \
-    N_("Align destination of the string operations") },			      \
-  { "no-align-stringops",	 MASK_NO_ALIGN_STROPS,			      \
-    N_("Do not align destination of the string operations") },		      \
-  { "inline-all-stringops",	 MASK_INLINE_ALL_STROPS,		      \
-    N_("Inline all known string operations") },				      \
-  { "no-inline-all-stringops",	-MASK_INLINE_ALL_STROPS,		      \
-    N_("Do not inline all known string operations") },			      \
-  { "push-args",		-MASK_NO_PUSH_ARGS,			      \
-    N_("Use push instructions to save outgoing arguments") },		      \
-  { "no-push-args",		MASK_NO_PUSH_ARGS,			      \
-    N_("Do not use push instructions to save outgoing arguments") },	      \
-  { "accumulate-outgoing-args",	MASK_ACCUMULATE_OUTGOING_ARGS,		      \
-    N_("Use push instructions to save outgoing arguments") },		      \
-  { "no-accumulate-outgoing-args",-MASK_ACCUMULATE_OUTGOING_ARGS,	      \
-    N_("Do not use push instructions to save outgoing arguments") },	      \
-  { "mmx",			 MASK_MMX,				      \
-    N_("Support MMX built-in functions") },				      \
-  { "no-mmx",			 -(MASK_MMX|MASK_3DNOW|MASK_3DNOW_A),	      \
-    N_("Do not support MMX built-in functions") },			      \
-  { "3dnow",                     MASK_3DNOW,				      \
-    N_("Support 3DNow! built-in functions") },				      \
-  { "no-3dnow",                  -(MASK_3DNOW|MASK_3DNOW_A),		      \
-    N_("Do not support 3DNow! built-in functions") },			      \
-  { "sse",			 MASK_SSE,				      \
-    N_("Support MMX and SSE built-in functions and code generation") },	      \
-  { "no-sse",			 -(MASK_SSE|MASK_SSE2|MASK_SSE3),	      \
-    N_("Do not support MMX and SSE built-in functions and code generation") },\
-  { "sse2",			 MASK_SSE2,				      \
-    N_("Support MMX, SSE and SSE2 built-in functions and code generation") }, \
-  { "no-sse2",			 -(MASK_SSE2|MASK_SSE3),		      \
-    N_("Do not support MMX, SSE and SSE2 built-in functions and code generation") },    \
-  { "sse3",			 MASK_SSE3,				      \
-    N_("Support MMX, SSE, SSE2 and SSE3 built-in functions and code generation") },\
-  { "no-sse3",			 -MASK_SSE3,				      \
-    N_("Do not support MMX, SSE, SSE2 and SSE3 built-in functions and code generation") },\
-  { "128bit-long-double",	 MASK_128BIT_LONG_DOUBLE,		      \
-    N_("sizeof(long double) is 16") },					      \
-  { "96bit-long-double",	-MASK_128BIT_LONG_DOUBLE,		      \
-    N_("sizeof(long double) is 12") },					      \
-  { "64",			MASK_64BIT,				      \
-    N_("Generate 64bit x86-64 code") },					      \
-  { "32",			-MASK_64BIT,				      \
-    N_("Generate 32bit i386 code") },					      \
-  { "ms-bitfields",		MASK_MS_BITFIELD_LAYOUT,		      \
-    N_("Use native (MS) bitfield layout") },				      \
-  { "no-ms-bitfields",		-MASK_MS_BITFIELD_LAYOUT,		      \
-    N_("Use gcc default bitfield layout") },				      \
-  { "red-zone",			-MASK_NO_RED_ZONE,			      \
-    N_("Use red-zone in the x86-64 code") },				      \
-  { "no-red-zone",		MASK_NO_RED_ZONE,			      \
-    N_("Do not use red-zone in the x86-64 code") },			      \
-  { "tls-direct-seg-refs",	MASK_TLS_DIRECT_SEG_REFS,		      \
-    N_("Use direct references against %gs when accessing tls data") },	      \
-  { "no-tls-direct-seg-refs",	-MASK_TLS_DIRECT_SEG_REFS,		      \
-    N_("Do not use direct references against %gs when accessing tls data") }, \
-  SUBTARGET_SWITCHES							      \
-  { "",									      \
-    TARGET_DEFAULT | TARGET_64BIT_DEFAULT | TARGET_SUBTARGET_DEFAULT	      \
-    | TARGET_TLS_DIRECT_SEG_REFS_DEFAULT, 0 }}
-
 #ifndef TARGET_64BIT_DEFAULT
 #define TARGET_64BIT_DEFAULT 0
 #endif
@@ -468,48 +252,6 @@ #define TARGET_MACHO 0
    with the rounding mode forced to 53 bits.  */
 #define TARGET_96_ROUND_53_LONG_DOUBLE 0
 
-/* This macro is similar to `TARGET_SWITCHES' but defines names of
-   command options that have values.  Its definition is an
-   initializer with a subgrouping for each command option.
-
-   Each subgrouping contains a string constant, that defines the
-   fixed part of the option name, and the address of a variable.  The
-   variable, type `char *', is set to the variable part of the given
-   option if the fixed part matches.  The actual option name is made
-   by appending `-m' to the specified name.  */
-#define TARGET_OPTIONS						\
-{ { "tune=",		&ix86_tune_string,			\
-    N_("Schedule code for given CPU"), 0},			\
-  { "fpmath=",		&ix86_fpmath_string,			\
-    N_("Generate floating point mathematics using given instruction set"), 0},\
-  { "arch=",		&ix86_arch_string,			\
-    N_("Generate code for given CPU"), 0},			\
-  { "regparm=",		&ix86_regparm_string,			\
-    N_("Number of registers used to pass integer arguments"), 0},\
-  { "align-loops=",	&ix86_align_loops_string,		\
-    N_("Loop code aligned to this power of 2"), 0},		\
-  { "align-jumps=",	&ix86_align_jumps_string,		\
-    N_("Jump targets are aligned to this power of 2"), 0},	\
-  { "align-functions=",	&ix86_align_funcs_string,		\
-    N_("Function starts are aligned to this power of 2"), 0},	\
-  { "preferred-stack-boundary=",				\
-    &ix86_preferred_stack_boundary_string,			\
-    N_("Attempt to keep stack aligned to this power of 2"), 0},	\
-  { "branch-cost=",	&ix86_branch_cost_string,		\
-    N_("Branches are this expensive (1-5, arbitrary units)"), 0},\
-  { "cmodel=", &ix86_cmodel_string,				\
-    N_("Use given x86-64 code model"), 0},			\
-  { "debug-arg", &ix86_debug_arg_string,			\
-    "" /* Undocumented.  */, 0},				\
-  { "debug-addr", &ix86_debug_addr_string,			\
-    "" /* Undocumented.  */, 0},				\
-  { "asm=", &ix86_asm_string,					\
-    N_("Use given assembler dialect"), 0},			\
-  { "tls-dialect=", &ix86_tls_dialect_string,			\
-    N_("Use given thread-local storage dialect"), 0},		\
-  SUBTARGET_OPTIONS						\
-}
-
 /* Sometimes certain combinations of command options do not make
    sense on a particular target machine.  You can define a macro
    `OVERRIDE_OPTIONS' to take account of this.  This macro, if
@@ -521,10 +263,6 @@ #define TARGET_OPTIONS						\
 
 #define OVERRIDE_OPTIONS override_options ()
 
-/* These are meant to be redefined in the host dependent files */
-#define SUBTARGET_SWITCHES
-#define SUBTARGET_OPTIONS
-
 /* Define this to change the optimizations performed by default.  */
 #define OPTIMIZATION_OPTIONS(LEVEL, SIZE) \
   optimization_options ((LEVEL), (SIZE))
@@ -2409,7 +2147,6 @@ enum fpmath_unit
 };
 
 extern enum fpmath_unit ix86_fpmath;
-extern const char *ix86_fpmath_string;
 
 enum tls_dialect
 {
@@ -2418,7 +2155,6 @@ enum tls_dialect
 };
 
 extern enum tls_dialect ix86_tls_dialect;
-extern const char *ix86_tls_dialect_string;
 
 enum cmodel {
   CM_32,	/* The traditional 32-bit ABI.  */
@@ -2430,7 +2166,6 @@ enum cmodel {
 };
 
 extern enum cmodel ix86_cmodel;
-extern const char *ix86_cmodel_string;
 
 /* Size of the RED_ZONE area.  */
 #define RED_ZONE_SIZE 128
@@ -2442,25 +2177,9 @@ enum asm_dialect {
   ASM_INTEL
 };
 
-extern const char *ix86_asm_string;
 extern enum asm_dialect ix86_asm_dialect;
-
-extern int ix86_regparm;
-extern const char *ix86_regparm_string;
-
 extern unsigned int ix86_preferred_stack_boundary;
-extern const char *ix86_preferred_stack_boundary_string;
-
 extern int ix86_branch_cost;
-extern const char *ix86_branch_cost_string;
-
-extern const char *ix86_debug_arg_string;
-extern const char *ix86_debug_addr_string;
-
-/* Obsoleted by -f options.  Remove before 3.2 ships.  */
-extern const char *ix86_align_loops_string;
-extern const char *ix86_align_jumps_string;
-extern const char *ix86_align_funcs_string;
 
 /* Smallest class containing REGNO.  */
 extern enum reg_class const regclass_map[FIRST_PSEUDO_REGISTER];
Index: config/i386/cygming.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/i386/cygming.h,v
retrieving revision 1.26
diff -u -p -F^\([(a-zA-Z0-9_]\|#define\) -r1.26 cygming.h
--- config/i386/cygming.h	5 Apr 2005 04:08:56 -0000	1.26
+++ config/i386/cygming.h	20 Apr 2005 20:30:09 -0000
@@ -50,26 +50,6 @@ #define TARGET_EXECUTABLE_SUFFIX ".exe"
 
 #include <stdio.h>
 
-/* Masks for subtarget switches used by other files.  */
-#define MASK_NOP_FUN_DLLIMPORT 0x08000000 /* Ignore dllimport for functions */
-
-/* Used in winnt.c.  */
-#define TARGET_NOP_FUN_DLLIMPORT (target_flags & MASK_NOP_FUN_DLLIMPORT)
-
-#undef  SUBTARGET_SWITCHES
-#define SUBTARGET_SWITCHES \
-{ "cygwin",		  0, N_("Use the Cygwin interface") },	\
-{ "no-cygwin",		  0, N_("Use the Mingw32 interface") },	\
-{ "windows",		  0, N_("Create GUI application") },	\
-{ "no-win32",		  0, N_("Don't set Windows defines") },	\
-{ "win32",		  0, N_("Set Windows defines") },	\
-{ "console",		  0, N_("Create console application") },\
-{ "dll",		  0, N_("Generate code for a DLL") },	\
-{ "nop-fun-dllimport",	  MASK_NOP_FUN_DLLIMPORT,		\
-  N_("Ignore dllimport for functions") },			\
-{ "no-nop-fun-dllimport", -MASK_NOP_FUN_DLLIMPORT, "" },	\
-{ "threads",		  0, N_("Use Mingw-specific thread support") },
-
 #define MAYBE_UWIN_CPP_BUILTINS() /* Nothing.  */
 
 #define TARGET_OS_CPP_BUILTINS()					\
Index: config/i386/djgpp.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/i386/djgpp.h,v
retrieving revision 1.48
diff -u -p -F^\([(a-zA-Z0-9_]\|#define\) -r1.48 djgpp.h
--- config/i386/djgpp.h	31 Jan 2004 02:06:57 -0000	1.48
+++ config/i386/djgpp.h	20 Apr 2005 20:30:09 -0000
@@ -169,24 +169,14 @@ #define PTRDIFF_TYPE "int"
 /* Used to be defined in xm-djgpp.h, but moved here for cross-compilers.  */
 #define LIBSTDCXX "-lstdcxx"
 
-/* -mbnu210 is now ignored and obsolete. It was used to enable support for
-   weak symbols, and .gnu.linkonce support.  */
-#undef MASK_BNU210
-#define MASK_BNU210 (0x40000000)
-
 #define TARGET_VERSION fprintf (stderr, " (80386, MS-DOS DJGPP)"); 
 
-#undef SUBTARGET_SWITCHES
-#define SUBTARGET_SWITCHES \
-  { "no-bnu210", -MASK_BNU210, "Ignored (obsolete)" }, \
-  { "bnu210", MASK_BNU210, "Ignored (obsolete)" },
-
 /* Warn that -mbnu210 is now obsolete.  */
 #undef  SUBTARGET_OVERRIDE_OPTIONS
 #define SUBTARGET_OVERRIDE_OPTIONS \
 do \
   { \
-    if (target_flags & MASK_BNU210) \
+    if (TARGET_BNU210) \
       {	\
         warning ("-mbnu210 is ignored (option is obsolete)"); \
       }	\
Index: config/i386/lynx.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/i386/lynx.h,v
retrieving revision 1.10
diff -u -p -F^\([(a-zA-Z0-9_]\|#define\) -r1.10 lynx.h
--- config/i386/lynx.h	5 Aug 2004 04:55:36 -0000	1.10
+++ config/i386/lynx.h	20 Apr 2005 20:30:09 -0000
@@ -71,12 +71,6 @@ #define ASM_OUTPUT_MAX_SKIP_ALIGN(FILE,L
   } while (0)
 #endif
 
-/* Since i386.h defines an empty SUBTARGET_SWITCHES the definition in
-   config/lynx.h is omitted.  */
-
-#undef SUBTARGET_SWITCHES
-#define SUBTARGET_SWITCHES SUBTARGET_OS_LYNX_SWITCHES
-
 /* Undefine SUBTARGET_EXTRA_SPECS it is empty anyway.  We define it in
    config/lynx.h.  */
 
Index: config/i386/sco5.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/i386/sco5.h,v
retrieving revision 1.85
diff -u -p -F^\([(a-zA-Z0-9_]\|#define\) -r1.85 sco5.h
--- config/i386/sco5.h	17 Oct 2004 18:09:39 -0000	1.85
+++ config/i386/sco5.h	20 Apr 2005 20:30:09 -0000
@@ -281,14 +281,6 @@ #define LIB_SPEC \
 #define LIBGCC_SPEC \
  "%{!shared:%{!G:-lgcc}}"
 
-/* Here for legacy support only so we still accept -melf flag */
-#define MASK_COFF     		010000000000	/* Mask for COFF generation */
-#define TARGET_ELF              (1)
-
-#undef SUBTARGET_SWITCHES
-#define SUBTARGET_SWITCHES 					\
-	{ "elf", -MASK_COFF, N_("Generate ELF output")  },
-
 /* Handle special EH pointer encodings.  Absolute, pc-relative, and
    indirect are handled automatically.  */
 #define ASM_MAYBE_OUTPUT_ENCODED_ADDR_RTX(FILE, ENCODING, SIZE, ADDR, DONE) \
Index: config/i386/i386.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/i386/i386.c,v
retrieving revision 1.811
diff -u -p -F^\([(a-zA-Z0-9_]\|#define\) -r1.811 i386.c
--- config/i386/i386.c	14 Apr 2005 23:42:45 -0000	1.811
+++ config/i386/i386.c	20 Apr 2005 20:30:13 -0000
@@ -787,17 +787,15 @@ struct ix86_frame
   bool save_regs_using_mov;
 };
 
-/* Used to enable/disable debugging features.  */
-const char *ix86_debug_arg_string, *ix86_debug_addr_string;
 /* Code model option as passed by user.  */
-const char *ix86_cmodel_string;
+static const char *ix86_cmodel_string;
 /* Parsed value.  */
 enum cmodel ix86_cmodel;
 /* Asm dialect.  */
-const char *ix86_asm_string;
+static const char *ix86_asm_string;
 enum asm_dialect ix86_asm_dialect = ASM_ATT;
 /* TLS dialext.  */
-const char *ix86_tls_dialect_string;
+static const char *ix86_tls_dialect_string;
 enum tls_dialect ix86_tls_dialect = TLS_DIALECT_GNU;
 
 /* Which unit we are generating floating point math for.  */
@@ -811,42 +809,43 @@ enum processor_type ix86_arch;
 /* Strings to hold which cpu and instruction set architecture  to use.  */
 const char *ix86_tune_string;		/* for -mtune=<xxx> */
 const char *ix86_arch_string;		/* for -march=<xxx> */
-const char *ix86_fpmath_string;		/* for -mfpmath=<xxx> */
+static const char *ix86_fpmath_string;	/* for -mfpmath=<xxx> */
 
 /* # of registers to use to pass arguments.  */
-const char *ix86_regparm_string;
+static const char *ix86_regparm_string;
 
 /* true if sse prefetch instruction is not NOOP.  */
 int x86_prefetch_sse;
 
 /* ix86_regparm_string as a number */
-int ix86_regparm;
+static int ix86_regparm;
 
 /* Alignment to use for loops and jumps:  */
 
 /* Power of two alignment for loops.  */
-const char *ix86_align_loops_string;
+static const char *ix86_align_loops_string;
 
 /* Power of two alignment for non-loop jumps.  */
-const char *ix86_align_jumps_string;
+static const char *ix86_align_jumps_string;
 
 /* Power of two alignment for stack boundary in bytes.  */
-const char *ix86_preferred_stack_boundary_string;
+static const char *ix86_preferred_stack_boundary_string;
 
 /* Preferred alignment for stack boundary in bits.  */
 unsigned int ix86_preferred_stack_boundary;
 
 /* Values 1-5: see jump.c */
 int ix86_branch_cost;
-const char *ix86_branch_cost_string;
+static const char *ix86_branch_cost_string;
 
 /* Power of two alignment for functions.  */
-const char *ix86_align_funcs_string;
+static const char *ix86_align_funcs_string;
 
 /* Prefix built by ASM_GENERATE_INTERNAL_LABEL.  */
 char internal_label_prefix[16];
 int internal_label_prefix_len;
 
+static bool ix86_handle_option (size_t, const char *, int);
 static void output_pic_addr_const (FILE *, rtx, int);
 static void put_condition_code (enum rtx_code, enum machine_mode,
 				int, int, FILE *);
@@ -1045,6 +1044,16 @@ #define TARGET_ASM_CAN_OUTPUT_MI_THUNK x
 #undef TARGET_ASM_FILE_START
 #define TARGET_ASM_FILE_START x86_file_start
 
+#undef TARGET_DEFAULT_TARGET_FLAGS
+#define TARGET_DEFAULT_TARGET_FLAGS	\
+  (TARGET_DEFAULT			\
+   | TARGET_64BIT_DEFAULT		\
+   | TARGET_SUBTARGET_DEFAULT		\
+   | TARGET_TLS_DIRECT_SEG_REFS_DEFAULT)
+
+#undef TARGET_HANDLE_OPTION
+#define TARGET_HANDLE_OPTION ix86_handle_option
+
 #undef TARGET_RTX_COSTS
 #define TARGET_RTX_COSTS ix86_rtx_costs
 #undef TARGET_ADDRESS_COST
@@ -1095,6 +1104,98 @@ struct gcc_target targetm = TARGET_INITI
 #define DEFAULT_PCC_STRUCT_RETURN 1
 #endif
 
+/* Implement TARGET_HANDLE_OPTION.  */
+
+static bool
+ix86_handle_option (size_t code, const char *arg, int value)
+{
+  switch (code)
+    {
+    case OPT_m3dnow:
+      if (!value)
+	{
+	  target_flags &= ~MASK_3DNOW_A;
+	  target_flags_explicit |= MASK_3DNOW_A;
+	}
+      return true;
+
+    case OPT_malign_functions_:
+      ix86_align_funcs_string = arg;
+      return true;
+
+    case OPT_malign_jumps_:
+      ix86_align_jumps_string = arg;
+      return true;
+
+    case OPT_malign_loops_:
+      ix86_align_loops_string = arg;
+      return true;
+
+    case OPT_march_:
+      ix86_arch_string = arg;
+      return true;
+
+    case OPT_masm_:
+      ix86_asm_string = arg;
+      return true;
+
+    case OPT_mbranch_cost_:
+      ix86_branch_cost_string = arg;
+      return true;
+
+    case OPT_mcmodel_:
+      ix86_cmodel_string = arg;
+      return true;
+
+    case OPT_mfpmath_:
+      ix86_fpmath_string = arg;
+      return true;
+
+    case OPT_mmmx:
+      if (!value)
+	{
+	  target_flags &= ~(MASK_3DNOW | MASK_3DNOW_A);
+	  target_flags_explicit |= MASK_3DNOW | MASK_3DNOW_A;
+	}
+      return true;
+
+    case OPT_mpreferred_stack_boundary_:
+      ix86_preferred_stack_boundary_string = arg;
+      return true;
+
+    case OPT_mregparm_:
+      ix86_regparm_string = arg;
+      return true;
+
+    case OPT_msse:
+      if (!value)
+	{
+	  target_flags &= ~(MASK_SSE2 | MASK_SSE3);
+	  target_flags_explicit |= MASK_SSE2 | MASK_SSE3;
+	}
+      return true;
+
+    case OPT_msse2:
+      if (!value)
+	{
+	  target_flags &= ~MASK_SSE3;
+	  target_flags_explicit |= MASK_SSE3;
+	}
+      return true;
+
+    case OPT_mtls_dialect_:
+      ix86_tls_dialect_string = arg;
+      return true;
+
+    case OPT_mtune_:
+      ix86_tune_string = arg;
+      return true;
+
+    default:
+      return true;
+    }
+}
+
 /* Sometimes certain combinations of command options do not make
    sense on a particular target machine.  You can define a macro
    `OVERRIDE_OPTIONS' to take account of this.  This macro, if
@@ -15908,10 +16009,6 @@ x86_order_regs_for_local_alloc (void)
      reg_alloc_order [pos++] = 0;
 }
 
-#ifndef TARGET_USE_MS_BITFIELD_LAYOUT
-#define TARGET_USE_MS_BITFIELD_LAYOUT 0
-#endif
-
 /* Handle a "ms_struct" or "gcc_struct" attribute; arguments as in
    struct attribute_spec.handler.  */
 static tree
@@ -15951,7 +16048,7 @@ ix86_handle_struct_attribute (tree *node
 static bool
 ix86_ms_bitfield_layout_p (tree record_type)
 {
-  return (TARGET_USE_MS_BITFIELD_LAYOUT &&
+  return (TARGET_MS_BITFIELD_LAYOUT &&
 	  !lookup_attribute ("gcc_struct", TYPE_ATTRIBUTES (record_type)))
     || lookup_attribute ("ms_struct", TYPE_ATTRIBUTES (record_type));
 }
Index: config/rs6000/darwin.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/rs6000/darwin.h,v
retrieving revision 1.77
diff -u -p -F^\([(a-zA-Z0-9_]\|#define\) -r1.77 darwin.h
--- config/rs6000/darwin.h	11 Apr 2005 23:30:44 -0000	1.77
+++ config/rs6000/darwin.h	20 Apr 2005 20:30:13 -0000
@@ -95,17 +95,6 @@ do {									\
         warning ("-fpic is not supported; -fPIC assumed");		\
         flag_pic = 2;							\
       }									\
-									\
-    /* Handle -mfix-and-continue.  */					\
-    if (darwin_fix_and_continue_switch)					\
-      {									\
-	const char *base = darwin_fix_and_continue_switch;		\
-	while (base[-1] != 'm') base--;					\
-									\
-	if (*darwin_fix_and_continue_switch != '\0')			\
-	  error ("invalid option %qs", base);				\
-	darwin_fix_and_continue = (base[0] != 'n');			\
-      }									\
   }									\
   if (TARGET_64BIT && ! TARGET_POWERPC64)				\
     {									\
@@ -391,7 +380,6 @@ #define DOUBLE_INT_ASM_OP "\t.quad\t"
 /* For binary compatibility with 2.95; Darwin C APIs use bool from
    stdbool.h, which was an int-sized enum in 2.95.  Users can explicitly
    choose to have sizeof(bool)==1 with the -mone-byte-bool switch. */
-extern const char *darwin_one_byte_bool;
 #define BOOL_TYPE_SIZE (darwin_one_byte_bool ? CHAR_TYPE_SIZE : INT_TYPE_SIZE)
 
 #undef REGISTER_TARGET_PRAGMAS
Index: config/rs6000/lynx.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/rs6000/lynx.h,v
retrieving revision 1.17
diff -u -p -F^\([(a-zA-Z0-9_]\|#define\) -r1.17 lynx.h
--- config/rs6000/lynx.h	5 Aug 2004 04:55:36 -0000	1.17
+++ config/rs6000/lynx.h	20 Apr 2005 20:30:13 -0000
@@ -89,9 +89,6 @@ #define ASM_APP_ON "#APP\n"
 #undef ASM_APP_OFF
 #define ASM_APP_OFF "#NO_APP\n"
 
-#undef EXTRA_SUBTARGET_SWITCHES
-#define EXTRA_SUBTARGET_SWITCHES SUBTARGET_OS_LYNX_SWITCHES
-
 /* LynxOS does not do anything with .fixup plus let's not create
    writable section for linkonce.r and linkonce.t.  */
 
Index: config/rs6000/rs6000.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/rs6000/rs6000.c,v
retrieving revision 1.809
diff -u -p -F^\([(a-zA-Z0-9_]\|#define\) -r1.809 rs6000.c
--- config/rs6000/rs6000.c	19 Apr 2005 07:07:11 -0000	1.809
+++ config/rs6000/rs6000.c	20 Apr 2005 20:30:17 -0000
@@ -1313,7 +1313,7 @@ rs6000_override_options (const char *def
       rs6000_darwin64_abi = 1;
       /* Setting to empty string is same as "-mone-byte-bool".  */
 #if TARGET_MACHO
-      darwin_one_byte_bool = "";
+      darwin_one_byte_bool = 1;
 #endif
       /* Default to natural alignment, for better performance.  */
       rs6000_alignment_flags = MASK_ALIGN_NATURAL;
diff -u /dev/null config/darwin.opt
--- /dev/null	2005-03-29 10:04:47.000000000 +0100
+++ config/darwin.opt	2005-04-20 21:29:38.446959026 +0100
@@ -0,0 +1,28 @@
+; Processor-independent options for Darwin.
+
+; Copyright (C) 2005 Free Software Foundation, Inc.
+;
+; This file is part of GCC.
+;
+; GCC is free software; you can redistribute it and/or modify it under
+; the terms of the GNU General Public License as published by the Free
+; Software Foundation; either version 2, or (at your option) any later
+; version.
+;
+; GCC is distributed in the hope that it will be useful, but WITHOUT ANY
+; WARRANTY; without even the implied warranty of MERCHANTABILITY or
+; FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+; for more details.
+;
+; You should have received a copy of the GNU General Public License
+; along with GCC; see the file COPYING.  If not, write to the Free
+; Software Foundation, 59 Temple Place - Suite 330, Boston, MA
+; 02111-1307, USA.
+
+mone-byte-bool
+Target RejectNegative Report Var(darwin_one_byte_bool)
+Set sizeof(bool) to 1
+
+mfix-and-continue
+Target Report Var(darwin_fix_and_continue)
+Generate code suitable for fast turn around debugging
diff -u /dev/null config/lynx.opt
--- /dev/null	2005-03-29 10:04:47.000000000 +0100
+++ config/lynx.opt	2005-04-20 21:29:28.488686824 +0100
@@ -0,0 +1,32 @@
+; Processor-independent options for LynxOS.
+
+; Copyright (C) 2005 Free Software Foundation, Inc.
+;
+; This file is part of GCC.
+;
+; GCC is free software; you can redistribute it and/or modify it under
+; the terms of the GNU General Public License as published by the Free
+; Software Foundation; either version 2, or (at your option) any later
+; version.
+;
+; GCC is distributed in the hope that it will be useful, but WITHOUT ANY
+; WARRANTY; without even the implied warranty of MERCHANTABILITY or
+; FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+; for more details.
+;
+; You should have received a copy of the GNU General Public License
+; along with GCC; see the file COPYING.  If not, write to the Free
+; Software Foundation, 59 Temple Place - Suite 330, Boston, MA
+; 02111-1307, USA.
+
+mlegacy-threads
+Target RejectNegative
+Support legacy multi-threading
+
+mshared
+Target RejectNegative
+Use shared libraries
+
+mthreads
+Target RejectNegative
+Support multi-threading
diff -u /dev/null config/i386/cygming.opt
--- /dev/null	2005-03-29 10:04:47.000000000 +0100
+++ config/i386/cygming.opt	2005-04-19 20:28:36.000000000 +0100
@@ -0,0 +1,48 @@
+; Cygwin- and MinGW-specific options.
+
+; Copyright (C) 2005 Free Software Foundation, Inc.
+;
+; This file is part of GCC.
+;
+; GCC is free software; you can redistribute it and/or modify it under
+; the terms of the GNU General Public License as published by the Free
+; Software Foundation; either version 2, or (at your option) any later
+; version.
+;
+; GCC is distributed in the hope that it will be useful, but WITHOUT ANY
+; WARRANTY; without even the implied warranty of MERCHANTABILITY or
+; FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+; for more details.
+;
+; You should have received a copy of the GNU General Public License
+; along with GCC; see the file COPYING.  If not, write to the Free
+; Software Foundation, 59 Temple Place - Suite 330, Boston, MA
+; 02111-1307, USA.
+
+mconsole
+Target RejectNegative
+Create console application
+
+mcygwin
+Target
+Use the Cygwin interface
+
+mdll
+Target RejectNegative
+Generate code for a DLL
+
+mnop-fun-dllimport
+Target Report Var(TARGET_NOP_FUN_DLLIMPORT)
+Ignore dllimport for functions
+
+mthreads
+Target RejectNegative
+Use Mingw-specific thread support
+
+mwin32
+Target
+Set Windows defines
+
+mwindows
+Target
+Create GUI application
diff -u /dev/null config/i386/djgpp.opt
--- /dev/null	2005-03-29 10:04:47.000000000 +0100
+++ config/i386/djgpp.opt	2005-04-19 20:15:57.000000000 +0100
@@ -0,0 +1,26 @@
+; DJGPP-specific options.
+
+; Copyright (C) 2005 Free Software Foundation, Inc.
+;
+; This file is part of GCC.
+;
+; GCC is free software; you can redistribute it and/or modify it under
+; the terms of the GNU General Public License as published by the Free
+; Software Foundation; either version 2, or (at your option) any later
+; version.
+;
+; GCC is distributed in the hope that it will be useful, but WITHOUT ANY
+; WARRANTY; without even the implied warranty of MERCHANTABILITY or
+; FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+; for more details.
+;
+; You should have received a copy of the GNU General Public License
+; along with GCC; see the file COPYING.  If not, write to the Free
+; Software Foundation, 59 Temple Place - Suite 330, Boston, MA
+; 02111-1307, USA.
+
+;; -mbnu210 is now ignored and obsolete.  It was used to enable support for
+;; weak symbols, and .gnu.linkonce support.
+mbnu210
+Target Var(TARGET_BNU210)
+Ignored (obsolete)
diff -u /dev/null config/i386/dummy-windows.opt
--- /dev/null	2005-03-29 10:04:47.000000000 +0100
+++ config/i386/dummy-windows.opt	2005-04-19 20:16:37.000000000 +0100
@@ -0,0 +1,26 @@
+; Dummy (undocumented) IA-32 and AMD64 options.
+
+; Copyright (C) 2005 Free Software Foundation, Inc.
+;
+; This file is part of GCC.
+;
+; GCC is free software; you can redistribute it and/or modify it under
+; the terms of the GNU General Public License as published by the Free
+; Software Foundation; either version 2, or (at your option) any later
+; version.
+;
+; GCC is distributed in the hope that it will be useful, but WITHOUT ANY
+; WARRANTY; without even the implied warranty of MERCHANTABILITY or
+; FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+; for more details.
+;
+; You should have received a copy of the GNU General Public License
+; along with GCC; see the file COPYING.  If not, write to the Free
+; Software Foundation, 59 Temple Place - Suite 330, Boston, MA
+; 02111-1307, USA.
+
+mdll
+Target RejectNegative Undocumented
+
+mwindows
+Target RejectNegative Undocumented
diff -u /dev/null config/i386/i386.opt
--- /dev/null	2005-03-29 10:04:47.000000000 +0100
+++ config/i386/i386.opt	2005-04-19 22:56:55.000000000 +0100
@@ -0,0 +1,217 @@
+; Options for the IA-32 and AMD64 ports of the compiler.
+
+; Copyright (C) 2005 Free Software Foundation, Inc.
+;
+; This file is part of GCC.
+;
+; GCC is free software; you can redistribute it and/or modify it under
+; the terms of the GNU General Public License as published by the Free
+; Software Foundation; either version 2, or (at your option) any later
+; version.
+;
+; GCC is distributed in the hope that it will be useful, but WITHOUT ANY
+; WARRANTY; without even the implied warranty of MERCHANTABILITY or
+; FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+; for more details.
+;
+; You should have received a copy of the GNU General Public License
+; along with GCC; see the file COPYING.  If not, write to the Free
+; Software Foundation, 59 Temple Place - Suite 330, Boston, MA
+; 02111-1307, USA.
+
+m128bit-long-double
+Target RejectNegative Report Mask(128BIT_LONG_DOUBLE)
+sizeof(long double) is 16
+
+m32
+Target RejectNegative Report InverseMask(64BIT)
+Generate 32bit i386 code
+
+m386
+Target RejectNegative Undocumented
+;; Deprecated
+
+m3dnow
+Target Report Mask(3DNOW)
+Support 3DNow! built-in functions
+
+m486
+Target RejectNegative Undocumented
+;; Deprecated
+
+m64
+Target RejectNegative Report Mask(64BIT)
+Generate 64bit x86-64 code
+
+m80387
+Target Report Mask(80387)
+Use hardware fp
+
+m96bit-long-double
+Target RejectNegative Report InverseMask(128BIT_LONG_DOUBLE)
+sizeof(long double) is 12
+
+maccumulate-outgoing-args
+Target Report Mask(ACCUMULATE_OUTGOING_ARGS)
+Reserve space for outgoing arguments in the function prologue
+
+malign-double
+Target Report Mask(ALIGN_DOUBLE)
+Align some doubles on dword boundary
+
+malign-functions=
+Target RejectNegative Joined
+Function starts are aligned to this power of 2
+
+malign-jumps=
+Target RejectNegative Joined
+Jump targets are aligned to this power of 2
+
+malign-loops=
+Target RejectNegative Joined
+Loop code aligned to this power of 2
+
+malign-stringops
+Target RejectNegative Report InverseMask(NO_ALIGN_STRINGOPS, ALIGN_STRINGOPS)
+Align destination of the string operations
+
+march=
+Target RejectNegative Joined
+Generate code for given CPU
+
+masm=
+Target RejectNegative Joined
+Use given assembler dialect
+
+mbranch-cost=
+Target RejectNegative Joined
+Branches are this expensive (1-5, arbitrary units)
+
+mcmodel=
+Target RejectNegative Joined
+Use given x86-64 code model
+
+mdebug-addr
+Target RejectNegative Var(TARGET_DEBUG_ADDR) Undocumented
+
+mdebug-arg
+Target RejectNegative Var(TARGET_DEBUG_ARG) Undocumented
+
+mfancy-math-387
+Target RejectNegative Report InverseMask(NO_FANCY_MATH_387, USE_FANCY_MATH_387)
+Generate sin, cos, sqrt for FPU
+
+mfp-ret-in-387
+Target Report Mask(FLOAT_RETURNS)
+Return values of functions in FPU registers
+
+mfpmath=
+Target RejectNegative Joined
+Generate floating point mathematics using given instruction set
+
+mhard-float
+Target RejectNegative Mask(80387) MaskExists
+Use hardware fp
+
+mieee-fp
+Target Report Mask(IEEE_FP)
+Use IEEE math for fp comparisons
+
+minline-all-stringops
+Target Report Mask(INLINE_ALL_STRINGOPS)
+Inline all known string operations
+
+mintel-syntax
+Target Undocumented
+;; Deprecated
+
+mmmx
+Target Report Mask(MMX)
+Support MMX built-in functions
+
+mms-bitfields
+Target Report Mask(MS_BITFIELD_LAYOUT)
+Use native (MS) bitfield layout
+
+mno-align-stringops
+Target RejectNegative Report Mask(NO_ALIGN_STRINGOPS) Undocumented
+
+mno-fancy-math-387
+Target RejectNegative Report Mask(NO_FANCY_MATH_387) Undocumented
+
+mno-push-args
+Target RejectNegative Report Mask(NO_PUSH_ARGS) Undocumented
+
+mno-red-zone
+Target RejectNegative Report Mask(NO_RED_ZONE) Undocumented
+
+momit-leaf-frame-pointer
+Target Report Mask(OMIT_LEAF_FRAME_POINTER)
+Omit the frame pointer in leaf functions
+
+mpentium
+Target RejectNegative Undocumented
+;; Deprecated
+
+mpentiumpro
+Target RejectNegative Undocumented
+;; Deprecated
+
+mpreferred-stack-boundary=
+Target RejectNegative Joined
+Attempt to keep stack aligned to this power of 2
+
+mpush-args
+Target Report InverseMask(NO_PUSH_ARGS, PUSH_ARGS)
+Use push instructions to save outgoing arguments
+
+mred-zone
+Target RejectNegative Report InverseMask(NO_RED_ZONE, RED_ZONE)
+Use red-zone in the x86-64 code
+
+mregparm=
+Target RejectNegative Joined
+Number of registers used to pass integer arguments
+
+mrtd
+Target Report Mask(RTD)
+Alternate calling convention
+
+msoft-float
+Target InverseMask(80387)
+Do not use hardware fp
+
+msse
+Target Report Mask(SSE)
+Support MMX and SSE built-in functions and code generation
+
+msse2
+Target Report Mask(SSE2)
+Support MMX, SSE and SSE2 built-in functions and code generation
+
+msse3
+Target Report Mask(SSE3)
+Support MMX, SSE, SSE2 and SSE3 built-in functions and code generation
+
+msvr3-shlib
+Target Report Mask(SVR3_SHLIB)
+Uninitialized locals in .bss
+
+mstack-arg-probe
+Target Report Mask(STACK_PROBE)
+Enable stack probing
+
+mtls-dialect=
+Target RejectNegative Joined
+Use given thread-local storage dialect
+
+mtls-direct-seg-refs
+Target Report Mask(TLS_DIRECT_SEG_REFS)
+Use direct references against %gs when accessing tls data
+
+mtune=
+Target RejectNegative Joined
+Schedule code for given CPU
+
+;; Support Athlon 3Dnow builtins
+Mask(3DNOW_A)
diff -u /dev/null config/i386/sco5.opt
--- /dev/null	2005-03-29 10:04:47.000000000 +0100
+++ config/i386/sco5.opt	2005-04-19 21:11:02.000000000 +0100
@@ -0,0 +1,25 @@
+; SCO Unix-specific options.
+
+; Copyright (C) 2005 Free Software Foundation, Inc.
+;
+; This file is part of GCC.
+;
+; GCC is free software; you can redistribute it and/or modify it under
+; the terms of the GNU General Public License as published by the Free
+; Software Foundation; either version 2, or (at your option) any later
+; version.
+;
+; GCC is distributed in the hope that it will be useful, but WITHOUT ANY
+; WARRANTY; without even the implied warranty of MERCHANTABILITY or
+; FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+; for more details.
+;
+; You should have received a copy of the GNU General Public License
+; along with GCC; see the file COPYING.  If not, write to the Free
+; Software Foundation, 59 Temple Place - Suite 330, Boston, MA
+; 02111-1307, USA.
+
+;; Legacy option
+melf
+Target RejectNegative
+Generate ELF output


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]