Commit 666a21a2 by Joseph Myers Committed by Joseph Myers

options.texi (NegativeAlias): Document.

	* doc/options.texi (NegativeAlias): Document.
	(Alias): Mention NegativeAlias.
	* opt-functions.awk: Handle NegativeAlias.
	* optc-gen.awk: Disallow NegativeAlias with multiple Alias
	arguments.
	* opts-common.c (decode_cmdline_option): Handle CL_NEGATIVE_ALIAS.
	* opts.h (CL_NEGATIVE_ALIAS): Define.
	* config/rs6000/rs6000.c (rs6000_parse_yes_no_option): Remove.
	(rs6000_handle_option): Don't handle OPT_mvrsave_, OPT_misel_ and
	OPT_mspe_.
	* config/rs6000/rs6000.opt (mvrsave=, misel=, mspe=): Replace with
	Alias entries.
	* config/rs6000/t-spe (MULTILIB_OPTIONS, MULTILIB_EXCEPTIONS): Use
	mno-spe and mno-isel instead of mspe=no and -misel=no.

From-SVN: r171745
parent 0fa4e351
2011-03-30 Joseph Myers <joseph@codesourcery.com>
* doc/options.texi (NegativeAlias): Document.
(Alias): Mention NegativeAlias.
* opt-functions.awk: Handle NegativeAlias.
* optc-gen.awk: Disallow NegativeAlias with multiple Alias
arguments.
* opts-common.c (decode_cmdline_option): Handle CL_NEGATIVE_ALIAS.
* opts.h (CL_NEGATIVE_ALIAS): Define.
* config/rs6000/rs6000.c (rs6000_parse_yes_no_option): Remove.
(rs6000_handle_option): Don't handle OPT_mvrsave_, OPT_misel_ and
OPT_mspe_.
* config/rs6000/rs6000.opt (mvrsave=, misel=, mspe=): Replace with
Alias entries.
* config/rs6000/t-spe (MULTILIB_OPTIONS, MULTILIB_EXCEPTIONS): Use
mno-spe and mno-isel instead of mspe=no and -misel=no.
2011-03-29 Mark Wielaard <mjw@redhat.com> 2011-03-29 Mark Wielaard <mjw@redhat.com>
* common.opt (fdebug-types-section): New flag. * common.opt (fdebug-types-section): New flag.
......
...@@ -1082,7 +1082,6 @@ static bool rs6000_handle_option (struct gcc_options *, struct gcc_options *, ...@@ -1082,7 +1082,6 @@ static bool rs6000_handle_option (struct gcc_options *, struct gcc_options *,
const struct cl_decoded_option *, const struct cl_decoded_option *,
location_t); location_t);
static int rs6000_loop_align_max_skip (rtx); static int rs6000_loop_align_max_skip (rtx);
static void rs6000_parse_yes_no_option (const char *, const char *, int *);
static int first_altivec_reg_to_save (void); static int first_altivec_reg_to_save (void);
static unsigned int compute_vrsave_mask (void); static unsigned int compute_vrsave_mask (void);
static void compute_save_world_info (rs6000_stack_t *info_ptr); static void compute_save_world_info (rs6000_stack_t *info_ptr);
...@@ -3820,24 +3819,6 @@ rs6000_preferred_simd_mode (enum machine_mode mode) ...@@ -3820,24 +3819,6 @@ rs6000_preferred_simd_mode (enum machine_mode mode)
return word_mode; return word_mode;
} }
/* Handle generic options of the form -mfoo=yes/no.
NAME is the option name.
VALUE is the option value.
FLAG is the pointer to the flag where to store a 1 or 0, depending on
whether the option value is 'yes' or 'no' respectively. */
static void
rs6000_parse_yes_no_option (const char *name, const char *value, int *flag)
{
if (value == 0)
return;
else if (!strcmp (value, "yes"))
*flag = 1;
else if (!strcmp (value, "no"))
*flag = 0;
else
error ("unknown -m%s= option specified: '%s'", name, value);
}
/* Implement TARGET_OPTION_INIT_STRUCT. */ /* Implement TARGET_OPTION_INIT_STRUCT. */
static void static void
...@@ -4337,31 +4318,11 @@ rs6000_handle_option (struct gcc_options *opts, struct gcc_options *opts_set, ...@@ -4337,31 +4318,11 @@ rs6000_handle_option (struct gcc_options *opts, struct gcc_options *opts_set,
TARGET_ALTIVEC_VRSAVE = value; TARGET_ALTIVEC_VRSAVE = value;
break; break;
case OPT_mvrsave_:
rs6000_explicit_options.vrsave = true;
rs6000_parse_yes_no_option ("vrsave", arg, &(TARGET_ALTIVEC_VRSAVE));
break;
case OPT_misel_:
target_flags_explicit |= MASK_ISEL;
isel = 0;
rs6000_parse_yes_no_option ("isel", arg, &isel);
if (isel)
target_flags |= MASK_ISEL;
else
target_flags &= ~MASK_ISEL;
break;
case OPT_mspe: case OPT_mspe:
rs6000_explicit_options.spe = true; rs6000_explicit_options.spe = true;
rs6000_spe = value; rs6000_spe = value;
break; break;
case OPT_mspe_:
rs6000_explicit_options.spe = true;
rs6000_parse_yes_no_option ("spe", arg, &(rs6000_spe));
break;
case OPT_mdebug_: case OPT_mdebug_:
p = ASTRDUP (arg); p = ASTRDUP (arg);
rs6000_debug = 0; rs6000_debug = 0;
......
; Options for the rs6000 port of the compiler ; Options for the rs6000 port of the compiler
; ;
; Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010 Free Software ; Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software
; Foundation, Inc. ; Foundation, Inc.
; Contributed by Aldy Hernandez <aldy@quesejoda.com>. ; Contributed by Aldy Hernandez <aldy@quesejoda.com>.
; ;
...@@ -353,9 +353,13 @@ mvrsave ...@@ -353,9 +353,13 @@ mvrsave
Target Report Var(TARGET_ALTIVEC_VRSAVE) Save Target Report Var(TARGET_ALTIVEC_VRSAVE) Save
Generate VRSAVE instructions when generating AltiVec code Generate VRSAVE instructions when generating AltiVec code
mvrsave= mvrsave=no
Target RejectNegative Joined Target RejectNegative Alias(mvrsave) NegativeAlias
-mvrsave=yes/no Deprecated option. Use -mvrsave/-mno-vrsave instead Deprecated option. Use -mno-vrsave instead
mvrsave=yes
Target RejectNegative Alias(mvrsave)
Deprecated option. Use -mvrsave instead
mblock-move-inline-limit= mblock-move-inline-limit=
Target Report Var(rs6000_block_move_inline_limit) Init(0) RejectNegative Joined UInteger Save Target Report Var(rs6000_block_move_inline_limit) Init(0) RejectNegative Joined UInteger Save
...@@ -365,9 +369,13 @@ misel ...@@ -365,9 +369,13 @@ misel
Target Report Mask(ISEL) Save Target Report Mask(ISEL) Save
Generate isel instructions Generate isel instructions
misel= misel=no
Target RejectNegative Joined Target RejectNegative Alias(misel) NegativeAlias
-misel=yes/no Deprecated option. Use -misel/-mno-isel instead Deprecated option. Use -mno-isel instead
misel=yes
Target RejectNegative Alias(misel)
Deprecated option. Use -misel instead
mspe mspe
Target Target
...@@ -377,9 +385,13 @@ mpaired ...@@ -377,9 +385,13 @@ mpaired
Target Var(rs6000_paired_float) Save Target Var(rs6000_paired_float) Save
Generate PPC750CL paired-single instructions Generate PPC750CL paired-single instructions
mspe= mspe=no
Target RejectNegative Joined Target RejectNegative Alias(mspe) NegativeAlias
-mspe=yes/no Deprecated option. Use -mspe/-mno-spe instead Deprecated option. Use -mno-spe instead
mspe=yes
Target RejectNegative Alias(mspe)
Deprecated option. Use -mspe instead
mdebug= mdebug=
Target RejectNegative Joined Target RejectNegative Joined
......
# Multilibs for e500 # Multilibs for e500
# #
# Copyright (C) 2003 Free Software Foundation, Inc. # Copyright (C) 2003, 2011 Free Software Foundation, Inc.
# #
# This file is part of GCC. # This file is part of GCC.
# #
...@@ -36,51 +36,51 @@ INSTALL_LIBGCC = install-multilib ...@@ -36,51 +36,51 @@ INSTALL_LIBGCC = install-multilib
# -mcpu=7400 -maltivec -mabi=altivec # -mcpu=7400 -maltivec -mabi=altivec
# -mcpu=7400 -msoft-float # -mcpu=7400 -msoft-float
# -msoft-float # -msoft-float
# -mspe=no -mabi=no-spe -misel=no # -mno-spe -mabi=no-spe -mno-isel
# so we'll need to create exceptions later below. # so we'll need to create exceptions later below.
MULTILIB_OPTIONS = mcpu=7400 \ MULTILIB_OPTIONS = mcpu=7400 \
maltivec \ maltivec \
mabi=altivec \ mabi=altivec \
msoft-float \ msoft-float \
mspe=no \ mno-spe \
mabi=no-spe \ mabi=no-spe \
misel=no \ mno-isel \
mlittle mlittle
MULTILIB_DIRNAMES = mpc7400 altivec abi-altivec \ MULTILIB_DIRNAMES = mpc7400 altivec abi-altivec \
nof no-spe no-abi-spe no-isel le nof no-spe no-abi-spe no-isel le
MULTILIB_EXCEPTIONS = maltivec mabi=altivec mspe=no mabi=no-spe misel=no \ MULTILIB_EXCEPTIONS = maltivec mabi=altivec mno-spe mabi=no-spe mno-isel \
maltivec/mabi=altivec \ maltivec/mabi=altivec \
mcpu=7400/maltivec \ mcpu=7400/maltivec \
mcpu=7400/mabi=altivec \ mcpu=7400/mabi=altivec \
*mcpu=7400/*mspe=no* \ *mcpu=7400/*mno-spe* \
*mcpu=7400/*mabi=no-spe* \ *mcpu=7400/*mabi=no-spe* \
*mcpu=7400/*misel=no* \ *mcpu=7400/*mno-isel* \
*maltivec/*msoft-float* \ *maltivec/*msoft-float* \
*maltivec/*mspe=no* \ *maltivec/*mno-spe* \
*maltivec/*mabi=no-spe* \ *maltivec/*mabi=no-spe* \
*maltivec/*misel=no* \ *maltivec/*mno-isel* \
*mabi=altivec/*msoft-float* \ *mabi=altivec/*msoft-float* \
*mabi=altivec/*mspe=no* \ *mabi=altivec/*mno-spe* \
*mabi=altivec/*mabi=no-spe* \ *mabi=altivec/*mabi=no-spe* \
*mabi=altivec/*misel=no* \ *mabi=altivec/*mno-isel* \
*msoft-float/*mspe=no* \ *msoft-float/*mno-spe* \
*msoft-float/*mabi=no-spe* \ *msoft-float/*mabi=no-spe* \
*msoft-float/*misel=no* \ *msoft-float/*mno-isel* \
mspe=no/mabi=no-spe \ mno-spe/mabi=no-spe \
mspe=no/misel=no \ mno-spe/mno-isel \
mabi=no-spe/misel=no \ mabi=no-spe/mno-isel \
misel=no/mlittle \ mno-isel/mlittle \
mabi=no-spe/misel=no/mlittle \ mabi=no-spe/mno-isel/mlittle \
mspe=no/mlittle \ mno-spe/mlittle \
mabi=spe/mlittle \ mabi=spe/mlittle \
mcpu=7400/mabi=altivec/mlittle \ mcpu=7400/mabi=altivec/mlittle \
mcpu=7400/maltivec/mlittle \ mcpu=7400/maltivec/mlittle \
mabi=no-spe/mlittle \ mabi=no-spe/mlittle \
mspe=no/misel=no/mlittle \ mno-spe/mno-isel/mlittle \
mspe=no/mabi=no-spe/mlittle \ mno-spe/mabi=no-spe/mlittle \
mabi=altivec/mlittle \ mabi=altivec/mlittle \
maltivec/mlittle \ maltivec/mlittle \
maltivec/mabi=altivec/mlittle maltivec/mabi=altivec/mlittle
...@@ -364,7 +364,8 @@ for later processing. ...@@ -364,7 +364,8 @@ for later processing.
@item Alias(@var{opt}) @item Alias(@var{opt})
@itemx Alias(@var{opt}, @var{arg}) @itemx Alias(@var{opt}, @var{arg})
@itemx Alias(@var{opt}, @var{posarg}, @var{negarg}) @itemx Alias(@var{opt}, @var{posarg}, @var{negarg})
The option is an alias for @option{-@var{opt}}. In the first form, The option is an alias for @option{-@var{opt}} (or the negative form
of that option, depending on @code{NegativeAlias}). In the first form,
any argument passed to the alias is considered to be passed to any argument passed to the alias is considered to be passed to
@option{-@var{opt}}, and @option{-@var{opt}} is considered to be @option{-@var{opt}}, and @option{-@var{opt}} is considered to be
negated if the alias is used in negated form. In the second form, the negated if the alias is used in negated form. In the second form, the
...@@ -387,6 +388,13 @@ not need to handle it and no @samp{OPT_} enumeration value is defined ...@@ -387,6 +388,13 @@ 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 NegativeAlias
For an option marked with @code{Alias(@var{opt})}, the option is
considered to be an alias for the positive form of @option{-@var{opt}}
if negated and for the negative form of @option{-@var{opt}} if not
negated. @code{NegativeAlias} may not be used with the forms of
@code{Alias} taking more than one argument.
@item Ignore @item Ignore
This option is ignored apart from printing any warning specified using 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_} @code{Warn}. The option will not be seen by specs and no @samp{OPT_}
......
# Copyright (C) 2003, 2004, 2007, 2008, 2009, 2010 # Copyright (C) 2003, 2004, 2007, 2008, 2009, 2010, 2011
# Free Software Foundation, Inc. # Free Software Foundation, Inc.
# Contributed by Kelley Cook, June 2004. # Contributed by Kelley Cook, June 2004.
# Original code from Neil Booth, May 2003. # Original code from Neil Booth, May 2003.
...@@ -90,6 +90,7 @@ function switch_flags (flags) ...@@ -90,6 +90,7 @@ function switch_flags (flags)
test_flag("RejectDriver", flags, " | CL_REJECT_DRIVER") \ test_flag("RejectDriver", flags, " | CL_REJECT_DRIVER") \
test_flag("NoDriverArg", flags, " | CL_NO_DRIVER_ARG") \ test_flag("NoDriverArg", flags, " | CL_NO_DRIVER_ARG") \
test_flag("SeparateAlias", flags, " | CL_SEPARATE_ALIAS") \ test_flag("SeparateAlias", flags, " | CL_SEPARATE_ALIAS") \
test_flag("NegativeAlias", flags, " | CL_NEGATIVE_ALIAS") \
test_flag("Save", flags, " | CL_SAVE") \ test_flag("Save", flags, " | CL_SAVE") \
test_flag("Joined", flags, " | CL_JOINED") \ test_flag("Joined", flags, " | CL_JOINED") \
test_flag("JoinedOrMissing", flags, " | CL_JOINED | CL_MISSING_OK") \ test_flag("JoinedOrMissing", flags, " | CL_JOINED | CL_MISSING_OK") \
......
...@@ -362,6 +362,11 @@ for (i = 0; i < n_opts; i++) { ...@@ -362,6 +362,11 @@ for (i = 0; i < n_opts; i++) {
print "#error Alias with single argument " \ print "#error Alias with single argument " \
"allowing negative form" "allowing negative form"
} }
if (alias_posarg != "" \
&& flag_set_p("NegativeAlias", flags[i])) {
print "#error Alias with multiple arguments " \
"used with NegativeAlias"
}
alias_opt = opt_enum(alias_opt) alias_opt = opt_enum(alias_opt)
if (alias_posarg == "") if (alias_posarg == "")
......
...@@ -507,6 +507,7 @@ decode_cmdline_option (const char **argv, unsigned int lang_mask, ...@@ -507,6 +507,7 @@ decode_cmdline_option (const char **argv, unsigned int lang_mask,
{ {
gcc_assert (option->alias_arg != NULL); gcc_assert (option->alias_arg != NULL);
gcc_assert (arg == NULL); gcc_assert (arg == NULL);
gcc_assert (!(option->flags & CL_NEGATIVE_ALIAS));
if (value) if (value)
arg = option->alias_arg; arg = option->alias_arg;
else else
...@@ -517,9 +518,13 @@ decode_cmdline_option (const char **argv, unsigned int lang_mask, ...@@ -517,9 +518,13 @@ decode_cmdline_option (const char **argv, unsigned int lang_mask,
{ {
gcc_assert (value == 1); gcc_assert (value == 1);
gcc_assert (arg == NULL); gcc_assert (arg == NULL);
gcc_assert (!(option->flags & CL_NEGATIVE_ALIAS));
arg = option->alias_arg; arg = option->alias_arg;
} }
if (option->flags & CL_NEGATIVE_ALIAS)
value = !value;
opt_index = new_opt_index; opt_index = new_opt_index;
option = new_option; option = new_option;
......
...@@ -115,6 +115,7 @@ extern const unsigned int cl_lang_count; ...@@ -115,6 +115,7 @@ extern const unsigned int cl_lang_count;
#define CL_MISSING_OK (1U << 28) /* Missing argument OK (joined). */ #define CL_MISSING_OK (1U << 28) /* Missing argument OK (joined). */
#define CL_UINTEGER (1U << 29) /* Argument is an integer >=0. */ #define CL_UINTEGER (1U << 29) /* Argument is an integer >=0. */
#define CL_UNDOCUMENTED (1U << 30) /* Do not output with --help. */ #define CL_UNDOCUMENTED (1U << 30) /* Do not output with --help. */
#define CL_NEGATIVE_ALIAS (1U << 31) /* Alias to negative form of option. */
/* Flags for an enumerated option argument. */ /* Flags for an enumerated option argument. */
#define CL_ENUM_CANONICAL (1 << 0) /* Canonical for this value. */ #define CL_ENUM_CANONICAL (1 << 0) /* Canonical for this value. */
......
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