* flags.h (g_switch_value, g_switch_set): Remove.
* opts.c (g_switch_value, g_switch_set): Remove.
* config/g.opt (G): Add Var(g_switch_value).
* config/alpha/alpha.c (alpha_handle_option): Don't handle -G
here.
(alpha_option_override): Check global_options_set.x_g_switch_value
instead of g_switch_set.
(alpha_in_small_data_p): Remove cast in comparison with
g_switch_value.
* config/alpha/elf.h (ASM_OUTPUT_ALIGNED_LOCAL): Cast
g_switch_value to unsigned HOST_WIDE_INT.
* config/frv/frv.c (frv_const_unspec_p): Remove cast in comparison
with g_switch_value.
(frv_handle_option): Don't handle -G here.
(frv_option_override): Check global_options_set.x_g_switch_value
instead of g_switch_set. Don't modify g_switch_set.
(frv_in_small_data_p): Remove cast in comparison with
g_switch_value.
* config/frv/frv.h (ASM_OUTPUT_ALIGNED_DECL_LOCAL): Cast
g_switch_value to unsigned HOST_WIDE_INT.
* config/ia64/ia64.c (ia64_handle_option): Don't handle -G here.
(ia64_option_override): Check global_options_set.x_g_switch_value
instead of g_switch_set.
* config/lm32/lm32.c (lm32_handle_option, TARGET_HANDLE_OPTION):
Remove.
(lm32_in_small_data_p): Remove cast in comparison with
g_switch_value.
* config/lm32/lm32.h (ASM_OUTPUT_ALIGNED_LOCAL,
ASM_OUTPUT_ALIGNED_COMMON): Cast g_switch_value to unsigned
HOST_WIDE_INT.
* config/m32r/m32r.c (m32r_handle_option): Don't handle -G here.
(m32r_init): Check global_options_set.x_g_switch_value instead of
g_switch_set.
(m32r_in_small_data_p): Remove cast in comparison with
g_switch_value.
(m32r_file_start): Format g_switch_value with %d.
* config/m32r/m32r.h (ASM_OUTPUT_ALIGNED_COMMON,
ASM_OUTPUT_ALIGNED_BSS): Cast g_switch_value to unsigned
HOST_WIDE_INT.
* config/microblaze/microblaze.c (microblaze_handle_option): Don't
handle -G here.
(microblaze_option_override): Check
global_options_set.x_g_switch_value instead of g_switch_set.
* config/mips/mips.c (mips_handle_option): Don't handle -G here.
(mips_option_override): Check global_options_set.x_g_switch_value
instead of g_switch_set.
* config/rs6000/rs6000.c (rs6000_handle_option): Don't handle -G
here.
(rs6000_file_start): Format g_switch_value with %d.
(small_data_operand, rs6000_elf_in_small_data_p): Remove casts in
comparisons with g_switch_value.
* config/rs6000/sysv4.h (SUBTARGET_OVERRIDE_OPTIONS): Check
global_options_set.x_g_switch_value instead of g_switch_set.
* config/rs6000/vxworks.h (SUBSUBTARGET_OVERRIDE_OPTIONS): Check
global_options_set.x_g_switch_value instead of g_switch_set.
* config/score/score.c (score_handle_option): Don't handle -G
here.
* config/score/score3.c (score3_option_override): Check
global_options_set.x_g_switch_value instead of g_switch_set.
* config/score/score7.c (score7_option_override): Check
global_options_set.x_g_switch_value instead of g_switch_set.
From-SVN: r164960
+2010-10-04 Joseph Myers <joseph@codesourcery.com>
+
+ * flags.h (g_switch_value, g_switch_set): Remove.
+ * opts.c (g_switch_value, g_switch_set): Remove.
+ * config/g.opt (G): Add Var(g_switch_value).
+ * config/alpha/alpha.c (alpha_handle_option): Don't handle -G
+ here.
+ (alpha_option_override): Check global_options_set.x_g_switch_value
+ instead of g_switch_set.
+ (alpha_in_small_data_p): Remove cast in comparison with
+ g_switch_value.
+ * config/alpha/elf.h (ASM_OUTPUT_ALIGNED_LOCAL): Cast
+ g_switch_value to unsigned HOST_WIDE_INT.
+ * config/frv/frv.c (frv_const_unspec_p): Remove cast in comparison
+ with g_switch_value.
+ (frv_handle_option): Don't handle -G here.
+ (frv_option_override): Check global_options_set.x_g_switch_value
+ instead of g_switch_set. Don't modify g_switch_set.
+ (frv_in_small_data_p): Remove cast in comparison with
+ g_switch_value.
+ * config/frv/frv.h (ASM_OUTPUT_ALIGNED_DECL_LOCAL): Cast
+ g_switch_value to unsigned HOST_WIDE_INT.
+ * config/ia64/ia64.c (ia64_handle_option): Don't handle -G here.
+ (ia64_option_override): Check global_options_set.x_g_switch_value
+ instead of g_switch_set.
+ * config/lm32/lm32.c (lm32_handle_option, TARGET_HANDLE_OPTION):
+ Remove.
+ (lm32_in_small_data_p): Remove cast in comparison with
+ g_switch_value.
+ * config/lm32/lm32.h (ASM_OUTPUT_ALIGNED_LOCAL,
+ ASM_OUTPUT_ALIGNED_COMMON): Cast g_switch_value to unsigned
+ HOST_WIDE_INT.
+ * config/m32r/m32r.c (m32r_handle_option): Don't handle -G here.
+ (m32r_init): Check global_options_set.x_g_switch_value instead of
+ g_switch_set.
+ (m32r_in_small_data_p): Remove cast in comparison with
+ g_switch_value.
+ (m32r_file_start): Format g_switch_value with %d.
+ * config/m32r/m32r.h (ASM_OUTPUT_ALIGNED_COMMON,
+ ASM_OUTPUT_ALIGNED_BSS): Cast g_switch_value to unsigned
+ HOST_WIDE_INT.
+ * config/microblaze/microblaze.c (microblaze_handle_option): Don't
+ handle -G here.
+ (microblaze_option_override): Check
+ global_options_set.x_g_switch_value instead of g_switch_set.
+ * config/mips/mips.c (mips_handle_option): Don't handle -G here.
+ (mips_option_override): Check global_options_set.x_g_switch_value
+ instead of g_switch_set.
+ * config/rs6000/rs6000.c (rs6000_handle_option): Don't handle -G
+ here.
+ (rs6000_file_start): Format g_switch_value with %d.
+ (small_data_operand, rs6000_elf_in_small_data_p): Remove casts in
+ comparisons with g_switch_value.
+ * config/rs6000/sysv4.h (SUBTARGET_OVERRIDE_OPTIONS): Check
+ global_options_set.x_g_switch_value instead of g_switch_set.
+ * config/rs6000/vxworks.h (SUBSUBTARGET_OVERRIDE_OPTIONS): Check
+ global_options_set.x_g_switch_value instead of g_switch_set.
+ * config/score/score.c (score_handle_option): Don't handle -G
+ here.
+ * config/score/score3.c (score3_option_override): Check
+ global_options_set.x_g_switch_value instead of g_switch_set.
+ * config/score/score7.c (score7_option_override): Check
+ global_options_set.x_g_switch_value instead of g_switch_set.
+
2010-10-04 Vladimir Makarov <vmakarov@redhat.com>
* common.opt (fira-coalesce): Remove.
{
switch (code)
{
- case OPT_G:
- g_switch_value = value;
- g_switch_set = true;
- break;
-
case OPT_mfp_regs:
if (value == 0)
target_flags |= MASK_SOFT_FP;
}
/* Default the definition of "small data" to 8 bytes. */
- if (!g_switch_set)
+ if (!global_options_set.x_g_switch_value)
g_switch_value = 8;
/* Infer TARGET_SMALL_DATA from -fpic/-fPIC. */
/* If this is an incomplete type with size 0, then we can't put it
in sdata because it might be too big when completed. */
- if (size > 0 && (unsigned HOST_WIDE_INT) size <= g_switch_value)
+ if (size > 0 && size <= g_switch_value)
return true;
}
#undef ASM_OUTPUT_ALIGNED_LOCAL
#define ASM_OUTPUT_ALIGNED_LOCAL(FILE, NAME, SIZE, ALIGN) \
do { \
- if ((SIZE) <= g_switch_value) \
+ if ((SIZE) <= (unsigned HOST_WIDE_INT) g_switch_value) \
switch_to_section (sbss_section); \
else \
switch_to_section (bss_section); \
if (frv_small_data_reloc_p (unspec->symbol, unspec->reloc)
&& unspec->offset > 0
- && (unsigned HOST_WIDE_INT) unspec->offset < g_switch_value)
+ && unspec->offset < g_switch_value)
return true;
}
}
{
switch (code)
{
- case OPT_G:
- g_switch_value = value;
- g_switch_set = true;
- return true;
-
case OPT_mcpu_:
if (strcmp (arg, "simple") == 0)
frv_cpu_type = FRV_CPU_SIMPLE;
if (!flag_pic) /* -fPIC */
flag_pic = 2;
- if (! g_switch_set) /* -G0 */
+ if (!global_options_set.x_g_switch_value) /* -G0 */
{
- g_switch_set = 1;
g_switch_value = 0;
}
}
}
/* Check for small data option */
- if (!g_switch_set)
+ if (!global_options_set.x_g_switch_value && !TARGET_LIBPIC)
g_switch_value = SDATA_DEFAULT_SIZE;
/* A C expression which defines the machine-dependent operand
}
size = int_size_in_bytes (TREE_TYPE (decl));
- if (size > 0 && (unsigned HOST_WIDE_INT) size <= g_switch_value)
+ if (size > 0 && size <= g_switch_value)
return true;
return false;
#undef ASM_OUTPUT_ALIGNED_DECL_LOCAL
#define ASM_OUTPUT_ALIGNED_DECL_LOCAL(STREAM, DECL, NAME, SIZE, ALIGN) \
do { \
- if ((SIZE) > 0 && (SIZE) <= g_switch_value) \
+ if ((SIZE) > 0 && (SIZE) <= (unsigned HOST_WIDE_INT) g_switch_value) \
switch_to_section (get_named_section (NULL, ".sbss", 0)); \
else \
switch_to_section (bss_section); \
; Please try to keep this file in ASCII collating order.
G
-Target Joined Separate UInteger
+Target Joined Separate UInteger Var(g_switch_value)
-G<number> Put global and static data smaller than <number> bytes into a special section (on some targets)
; This comment is to ensure we retain the blank line above.
{
switch (code)
{
- case OPT_G:
- g_switch_value = value;
- g_switch_set = true;
- return true;
-
case OPT_mfixed_range_:
fix_range (arg);
return true;
flag_ira_loop_pressure = 1;
- ia64_section_threshold = g_switch_set ? g_switch_value : IA64_DEFAULT_GVALUE;
+ ia64_section_threshold = (global_options_set.x_g_switch_value
+ ? g_switch_value
+ : IA64_DEFAULT_GVALUE);
init_machine_status = ia64_init_machine_status;
static bool
lm32_legitimate_address_p (enum machine_mode mode, rtx x, bool strict);
static HOST_WIDE_INT lm32_compute_frame_size (int size);
-static bool lm32_handle_option (size_t code, const char *arg, int value);
static void lm32_option_override (void);
-#undef TARGET_HANDLE_OPTION
-#define TARGET_HANDLE_OPTION lm32_handle_option
#undef TARGET_OPTION_OVERRIDE
#define TARGET_OPTION_OVERRIDE lm32_option_override
#undef TARGET_ADDRESS_COST
}
}
-/* Implement TARGET_HANDLE_OPTION. */
-
-static bool
-lm32_handle_option (size_t code, const char *arg ATTRIBUTE_UNUSED, int value)
-{
- switch (code)
- {
- case OPT_G:
- g_switch_value = value;
- g_switch_set = true;
- return true;
-
- default:
- return true;
- }
-}
-
/* Override command line options. */
static void
lm32_option_override (void)
/* If this is an incomplete type with size 0, then we can't put it
in sdata because it might be too big when completed. */
- if (size > 0 && (unsigned HOST_WIDE_INT) size <= g_switch_value)
+ if (size > 0 && size <= g_switch_value)
return true;
}
#undef ASM_OUTPUT_ALIGNED_LOCAL
#define ASM_OUTPUT_ALIGNED_LOCAL(FILE, NAME, SIZE, ALIGN) \
do { \
- if ((SIZE) <= g_switch_value) \
+ if ((SIZE) <= (unsigned HOST_WIDE_INT) g_switch_value) \
switch_to_section (sbss_section); \
else \
switch_to_section (bss_section); \
#define ASM_OUTPUT_ALIGNED_COMMON(FILE, NAME, SIZE, ALIGN) \
do \
{ \
- if ((SIZE) <= g_switch_value) \
+ if ((SIZE) <= (unsigned HOST_WIDE_INT) g_switch_value) \
{ \
switch_to_section (sbss_section); \
(*targetm.asm_out.globalize_label) (FILE, NAME); \
{
switch (code)
{
- case OPT_G:
- g_switch_value = value;
- g_switch_set = true;
- return true;
-
case OPT_m32r:
target_flags &= ~(MASK_M32R2 | MASK_M32RX);
return true;
m32r_punct_chars['@'] = 1; /* ??? no longer used */
/* Provide default value if not specified. */
- if (!g_switch_set)
+ if (!global_options_set.x_g_switch_value)
g_switch_value = SDATA_DEFAULT_SIZE;
}
{
int size = int_size_in_bytes (TREE_TYPE (decl));
- if (size > 0 && (unsigned HOST_WIDE_INT) size <= g_switch_value)
+ if (size > 0 && size <= g_switch_value)
return true;
}
}
if (flag_verbose_asm)
fprintf (asm_out_file,
- "%s M32R/D special options: -G " HOST_WIDE_INT_PRINT_UNSIGNED "\n",
+ "%s M32R/D special options: -G %d\n",
ASM_COMMENT_START, g_switch_value);
if (TARGET_LITTLE_ENDIAN)
do \
{ \
if (! TARGET_SDATA_NONE \
- && (SIZE) > 0 && (SIZE) <= g_switch_value) \
+ && (SIZE) > 0 \
+ && (SIZE) <= (unsigned HOST_WIDE_INT) g_switch_value) \
fprintf ((FILE), "%s", SCOMMON_ASM_OP); \
else \
fprintf ((FILE), "%s", COMMON_ASM_OP); \
do \
{ \
if (! TARGET_SDATA_NONE \
- && (SIZE) > 0 && (SIZE) <= g_switch_value) \
+ && (SIZE) > 0 \
+ && (SIZE) <= (unsigned HOST_WIDE_INT) g_switch_value) \
switch_to_section (get_named_section (NULL, ".sbss", 0)); \
else \
switch_to_section (bss_section); \
{
switch (code)
{
- case OPT_G:
- g_switch_value = value;
- g_switch_set = true;
- return true;
-
case OPT_mno_clearbss:
flag_zero_initialized_in_bss = 0;
warning (0, "-mno-clearbss is deprecated; use -fno-zero-initialized-in-bss");
register enum machine_mode mode;
int ver;
- microblaze_section_threshold =
- g_switch_set ? g_switch_value : MICROBLAZE_DEFAULT_GVALUE;
+ microblaze_section_threshold = (global_options_set.x_g_switch_value
+ ? g_switch_value
+ : MICROBLAZE_DEFAULT_GVALUE);
/* Check the MicroBlaze CPU version for any special action to be done. */
if (microblaze_select_cpu == NULL)
{
switch (code)
{
- case OPT_G:
- g_switch_value = value;
- g_switch_set = true;
- return true;
-
case OPT_mabi_:
if (strcmp (arg, "32") == 0)
mips_abi = ABI_32;
TARGET_INTERLINK_MIPS16 = 1;
/* Set the small data limit. */
- mips_small_data_threshold = (g_switch_set
+ mips_small_data_threshold = (global_options_set.x_g_switch_value
? g_switch_value
: MIPS_DEFAULT_GVALUE);
switch (code)
{
- case OPT_G:
- g_switch_value = value;
- g_switch_set = true;
- break;
-
case OPT_mno_power:
target_flags &= ~(MASK_POWER | MASK_POWER2
| MASK_MULTIPLE | MASK_STRING);
if (rs6000_sdata && g_switch_value)
{
- fprintf (file, "%s -G " HOST_WIDE_INT_PRINT_UNSIGNED, start,
+ fprintf (file, "%s -G %d", start,
g_switch_value);
start = "";
}
/* We have to be careful here, because it is the referenced address
that must be 32k from _SDA_BASE_, not just the symbol. */
summand = INTVAL (XEXP (sum, 1));
- if (summand < 0 || (unsigned HOST_WIDE_INT) summand > g_switch_value)
+ if (summand < 0 || summand > g_switch_value)
return 0;
sym_ref = XEXP (sum, 0);
HOST_WIDE_INT size = int_size_in_bytes (TREE_TYPE (decl));
if (size > 0
- && (unsigned HOST_WIDE_INT) size <= g_switch_value
+ && size <= g_switch_value
/* If it's not public, and we're not going to reference it there,
there's no need to put it in the small data section. */
&& (rs6000_sdata != SDATA_DATA || TREE_PUBLIC (decl)))
#define SUBTARGET_OVERRIDE_OPTIONS \
do { \
- if (!g_switch_set) \
+ if (!global_options_set.x_g_switch_value) \
g_switch_value = SDATA_DEFAULT_SIZE; \
\
if (rs6000_abi_name == NULL) \
/* Definitions of target machine for GNU compiler. Vxworks PowerPC version.
- Copyright (C) 1996, 2000, 2002, 2003, 2004, 2005, 2007, 2009
+ Copyright (C) 1996, 2000, 2002, 2003, 2004, 2005, 2007, 2009, 2010
Free Software Foundation, Inc.
Contributed by CodeSourcery, LLC.
rs6000_float_gprs = 1; \
} \
\
- if (!g_switch_set) \
+ if (!global_options_set.x_g_switch_value) \
g_switch_value = SDATA_DEFAULT_SIZE; \
VXWORKS_OVERRIDE_OPTIONS; \
} while (0)
{
switch (code)
{
- case OPT_G:
- g_switch_value = value;
- g_switch_set = true;
- return true;
-
case OPT_mscore7d:
target_flags &= ~(MASK_ALL_CPU_BITS);
target_flags |= MASK_SCORE7 | MASK_SCORE7D;
{
flag_pic = false;
if (!flag_pic)
- score3_sdata_max = g_switch_set ? g_switch_value : SCORE3_DEFAULT_SDATA_MAX;
+ score3_sdata_max = (global_options_set.x_g_switch_value
+ ? g_switch_value
+ : SCORE3_DEFAULT_SDATA_MAX);
else
{
score3_sdata_max = 0;
- if (g_switch_set && (g_switch_value != 0))
+ if (global_options_set.x_g_switch_value && (g_switch_value != 0))
warning (0, "-fPIC and -G are incompatible");
}
{
flag_pic = false;
if (!flag_pic)
- score7_sdata_max = g_switch_set ? g_switch_value : SCORE7_DEFAULT_SDATA_MAX;
+ score7_sdata_max = (global_options_set.x_g_switch_value
+ ? g_switch_value
+ : SCORE7_DEFAULT_SDATA_MAX);
else
{
score7_sdata_max = 0;
- if (g_switch_set && (g_switch_value != 0))
+ if (global_options_set.x_g_switch_value && (g_switch_value != 0))
warning (0, "-fPIC and -G are incompatible");
}
/* Nonzero if subexpressions must be evaluated from left-to-right. */
extern int flag_evaluation_order;
-/* Value of the -G xx switch, and whether it was passed or not. */
-extern unsigned HOST_WIDE_INT g_switch_value;
-extern bool g_switch_set;
-
/* Whether to run the warn_unused_result attribute pass. */
extern bool flag_warn_unused_result;
#include "except.h"
#include "lto-streamer.h"
-/* Value of the -G xx switch, and whether it was passed or not. */
-unsigned HOST_WIDE_INT g_switch_value;
-bool g_switch_set;
-
/* True if we should exit after parsing options. */
bool exit_after_options;