Commit 05b12036 by Joseph Myers Committed by Joseph Myers

score.c (score_handle_option): Don't assert that global structures are in use.

	* config/score/score.c (score_handle_option): Don't assert that
	global structures are in use.  Access target_flags via opts
	pointer.  Use value of -march= option to determine target_flags
	settings.
	* config/score/score.opt (march=): Use Enum.
	(score_arch): New Enum and EnumValue entries.

From-SVN: r171329
parent dd51e35a
2011-03-22 Joseph Myers <joseph@codesourcery.com> 2011-03-22 Joseph Myers <joseph@codesourcery.com>
* config/score/score.c (score_handle_option): Don't assert that
global structures are in use. Access target_flags via opts
pointer. Use value of -march= option to determine target_flags
settings.
* config/score/score.opt (march=): Use Enum.
(score_arch): New Enum and EnumValue entries.
2011-03-22 Joseph Myers <joseph@codesourcery.com>
* config/mep/mep.c (option_mtiny_specified): Remove. * config/mep/mep.c (option_mtiny_specified): Remove.
(mep_option_override): Move register handling for -mivc2 from (mep_option_override): Move register handling for -mivc2 from
mep_handle_option. Use global_options_set.x_mep_tiny_cutoff mep_handle_option. Use global_options_set.x_mep_tiny_cutoff
......
...@@ -283,38 +283,25 @@ score_asm_file_end (void) ...@@ -283,38 +283,25 @@ score_asm_file_end (void)
/* Implement TARGET_HANDLE_OPTION. */ /* Implement TARGET_HANDLE_OPTION. */
static bool static bool
score_handle_option (struct gcc_options *opts, struct gcc_options *opts_set, score_handle_option (struct gcc_options *opts,
struct gcc_options *opts_set ATTRIBUTE_UNUSED,
const struct cl_decoded_option *decoded, const struct cl_decoded_option *decoded,
location_t loc ATTRIBUTE_UNUSED) location_t loc ATTRIBUTE_UNUSED)
{ {
size_t code = decoded->opt_index; size_t code = decoded->opt_index;
const char *arg = decoded->arg; int value = decoded->value;
gcc_assert (opts == &global_options);
gcc_assert (opts_set == &global_options_set);
switch (code) switch (code)
{ {
case OPT_mscore7d: case OPT_mscore7d:
target_flags &= ~(MASK_ALL_CPU_BITS); opts->x_target_flags &= ~(MASK_ALL_CPU_BITS);
target_flags |= MASK_SCORE7 | MASK_SCORE7D; opts->x_target_flags |= MASK_SCORE7 | MASK_SCORE7D;
return true; return true;
case OPT_march_: case OPT_march_:
if (strcmp (arg, "score7") == 0) opts->x_target_flags &= ~(MASK_ALL_CPU_BITS);
{ opts->x_target_flags |= value;
target_flags &= ~(MASK_ALL_CPU_BITS);
target_flags |= MASK_SCORE7;
return true; return true;
}
else if (strcmp (arg, "score7d") == 0)
{
target_flags &= ~(MASK_ALL_CPU_BITS);
target_flags |= MASK_SCORE7 | MASK_SCORE7D;
return true;
}
else
return false;
default: default:
return true; return true;
......
; Options for the Sunnorth port of the compiler. ; Options for the Sunnorth port of the compiler.
; Copyright (C) 2005, 2007, 2010 Free Software Foundation, Inc. ; Copyright (C) 2005, 2007, 2010, 2011 Free Software Foundation, Inc.
; ;
; This file is part of GCC. ; This file is part of GCC.
; ;
...@@ -43,5 +43,15 @@ Target RejectNegative Report Mask(SCORE7D) ...@@ -43,5 +43,15 @@ Target RejectNegative Report Mask(SCORE7D)
Support SCORE 7D ISA Support SCORE 7D ISA
march= march=
Target RejectNegative Joined Target RejectNegative Joined Enum(score_arch)
Specify the name of the target architecture Specify the name of the target architecture
Enum
Name(score_arch) Type(int)
Known SCORE architectures (for use with the -march= option):
EnumValue
Enum(score_arch) String(score7) Value(MASK_SCORE7)
EnumValue
Enum(score_arch) String(score7d) Value(MASK_SCORE7 | MASK_SCORE7D)
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