summaryrefslogtreecommitdiff
path: root/gcc/config
diff options
context:
space:
mode:
authorJoseph Myers <joseph@codesourcery.com>2010-10-15 20:19:05 +0100
committerJoseph Myers <jsm28@gcc.gnu.org>2010-10-15 20:19:05 +0100
commit7e4aae92f2dab0434634b62934df54c2bddc343c (patch)
tree1f752e7fb5a31733398e03579f85eb3c38e1a24a /gcc/config
parentae422ccd65c72f713ffb33319a8bc5436d8bc858 (diff)
downloadgcc-7e4aae92f2dab0434634b62934df54c2bddc343c.tar.gz
target.def (target_option.init_struct): New hook.
* target.def (target_option.init_struct): New hook. * doc/tm.texi.in (TARGET_OPTION_INIT_STRUCT): New @hook. * doc/tm.texi: Regenerate. * hooks.c (hook_void_gcc_optionsp): New. * hooks.h (hook_void_gcc_optionsp): Declare. * langhooks-def.h (lhd_init_options_struct): Remove. (LANG_HOOKS_INIT_OPTIONS_STRUCT): Define to hook_void_gcc_optionsp. * langhooks.c (lhd_init_options_struct): Remove. * opts.c (init_options_struct): Also call targetm.target_option.init_struct. * config/i386/i386.c (ix86_option_init_struct, TARGET_OPTION_INIT_STRUCT): New. (ix86_option_optimization): Move some settings to ix86_option_init_struct. * config/pdp11/pdp11.c (pdp11_option_init_struct, TARGET_OPTION_INIT_STRUCT): New. (pdp11_option_optimization): Move some settings to pdp11_option_init_struct. * config/rs6000/rs6000.c (rs6000_option_optimization): Replace by rs6000_option_init_struct. Use options structure pointer. (TARGET_OPTION_OPTIMIZATION): Replace by TARGET_OPTION_INIT_STRUCT. * config/s390/s390.c (s390_option_init_struct, TARGET_OPTION_INIT_STRUCT): New. (s390_option_optimization): Don't set flag_asynchronous_unwind_tables here. * config/sh/sh.c (sh_option_init_struct, TARGET_OPTION_INIT_STRUCT): New. (sh_option_optimization): Don't set flag_finite_math_only here. * config/spu/spu.c (spu_option_optimization): Replace by spu_option_optimization. Use options structure pointer. (TARGET_OPTION_OPTIMIZATION): Replace by TARGET_OPTION_INIT_STRUCT. From-SVN: r165519
Diffstat (limited to 'gcc/config')
-rw-r--r--gcc/config/i386/i386.c25
-rw-r--r--gcc/config/pdp11/pdp11.c16
-rw-r--r--gcc/config/rs6000/rs6000.c15
-rw-r--r--gcc/config/s390/s390.c17
-rw-r--r--gcc/config/sh/sh.c19
-rw-r--r--gcc/config/spu/spu.c10
6 files changed, 70 insertions, 32 deletions
diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c
index 91e38393890..4536ef22ea8 100644
--- a/gcc/config/i386/i386.c
+++ b/gcc/config/i386/i386.c
@@ -4537,11 +4537,6 @@ ix86_option_optimization (int level, int size ATTRIBUTE_UNUSED)
flag_schedule_insns = 0;
#endif
- if (TARGET_MACHO)
- /* The Darwin libraries never set errno, so we might as well
- avoid calling them when that's the only reason we would. */
- flag_errno_math = 0;
-
/* The default values of these switches depend on the TARGET_64BIT
that is not known at this moment. Mark these values with 2 and
let user the to override these. In case there is no command line
@@ -4554,14 +4549,26 @@ ix86_option_optimization (int level, int size ATTRIBUTE_UNUSED)
if (level > 1)
flag_zee = 2;
- flag_pcc_struct_return = 2;
- flag_asynchronous_unwind_tables = 2;
- flag_vect_cost_model = 1;
#ifdef SUBTARGET_OPTIMIZATION_OPTIONS
SUBTARGET_OPTIMIZATION_OPTIONS;
#endif
}
+/* Implement TARGET_OPTION_INIT_STRUCT. */
+
+static void
+ix86_option_init_struct (struct gcc_options *opts)
+{
+ if (TARGET_MACHO)
+ /* The Darwin libraries never set errno, so we might as well
+ avoid calling them when that's the only reason we would. */
+ opts->x_flag_errno_math = 0;
+
+ opts->x_flag_pcc_struct_return = 2;
+ opts->x_flag_asynchronous_unwind_tables = 2;
+ opts->x_flag_vect_cost_model = 1;
+}
+
/* Decide whether we must probe the stack before any space allocation
on this target. It's essentially TARGET_STACK_PROBE except when
-fstack-check causes the stack to be already probed differently. */
@@ -33269,6 +33276,8 @@ ix86_autovectorize_vector_sizes (void)
#define TARGET_OPTION_OVERRIDE ix86_option_override
#undef TARGET_OPTION_OPTIMIZATION
#define TARGET_OPTION_OPTIMIZATION ix86_option_optimization
+#undef TARGET_OPTION_INIT_STRUCT
+#define TARGET_OPTION_INIT_STRUCT ix86_option_init_struct
#undef TARGET_REGISTER_MOVE_COST
#define TARGET_REGISTER_MOVE_COST ix86_register_move_cost
diff --git a/gcc/config/pdp11/pdp11.c b/gcc/config/pdp11/pdp11.c
index 651b0cc6012..e6b41596c13 100644
--- a/gcc/config/pdp11/pdp11.c
+++ b/gcc/config/pdp11/pdp11.c
@@ -146,6 +146,7 @@ decode_pdp11_d (const struct real_format *fmt ATTRIBUTE_UNUSED,
static bool pdp11_handle_option (size_t, const char *, int);
static void pdp11_option_optimization (int, int);
+static void pdp11_option_init_struct (struct gcc_options *);
static rtx find_addr_reg (rtx);
static const char *singlemove_string (rtx *);
static bool pdp11_assemble_integer (rtx, unsigned int, int);
@@ -189,6 +190,8 @@ static void pdp11_function_arg_advance (CUMULATIVE_ARGS *,
#define TARGET_HANDLE_OPTION pdp11_handle_option
#undef TARGET_OPTION_OPTIMIZATION
#define TARGET_OPTION_OPTIMIZATION pdp11_option_optimization
+#undef TARGET_OPTION_INIT_STRUCT
+#define TARGET_OPTION_INIT_STRUCT pdp11_option_init_struct
#undef TARGET_RTX_COSTS
#define TARGET_RTX_COSTS pdp11_rtx_costs
@@ -235,9 +238,6 @@ pdp11_handle_option (size_t code, const char *arg ATTRIBUTE_UNUSED,
static void
pdp11_option_optimization (int level, int size ATTRIBUTE_UNUSED)
{
- flag_finite_math_only = 0;
- flag_trapping_math = 0;
- flag_signaling_nans = 0;
if (level >= 3)
{
flag_omit_frame_pointer = 1;
@@ -245,6 +245,16 @@ pdp11_option_optimization (int level, int size ATTRIBUTE_UNUSED)
}
}
+/* Implement TARGET_OPTION_INIT_STRUCT. */
+
+static void
+pdp11_option_init_struct (struct gcc_options *opts)
+{
+ opts->x_flag_finite_math_only = 0;
+ opts->x_flag_trapping_math = 0;
+ opts->x_flag_signaling_nans = 0;
+}
+
/* Nonzero if OP is a valid second operand for an arithmetic insn. */
int
diff --git a/gcc/config/rs6000/rs6000.c b/gcc/config/rs6000/rs6000.c
index f9773018127..a1baa592fa9 100644
--- a/gcc/config/rs6000/rs6000.c
+++ b/gcc/config/rs6000/rs6000.c
@@ -1136,7 +1136,7 @@ static rtx altivec_expand_vec_set_builtin (tree);
static rtx altivec_expand_vec_ext_builtin (tree, rtx);
static int get_element_number (tree, tree);
static void rs6000_option_override (void);
-static void rs6000_option_optimization (int, int);
+static void rs6000_option_init_struct (struct gcc_options *);
static void rs6000_option_default_params (void);
static bool rs6000_handle_option (size_t, const char *, int);
static void rs6000_parse_tls_size_option (void);
@@ -1602,8 +1602,8 @@ static const struct attribute_spec rs6000_attribute_table[] =
#undef TARGET_OPTION_OVERRIDE
#define TARGET_OPTION_OVERRIDE rs6000_option_override
-#undef TARGET_OPTION_OPTIMIZATION
-#define TARGET_OPTION_OPTIMIZATION rs6000_option_optimization
+#undef TARGET_OPTION_INIT_STRUCT
+#define TARGET_OPTION_INIT_STRUCT rs6000_option_init_struct
#undef TARGET_OPTION_DEFAULT_PARAMS
#define TARGET_OPTION_DEFAULT_PARAMS rs6000_option_default_params
@@ -3681,18 +3681,19 @@ rs6000_parse_tls_size_option (void)
error ("bad value %qs for -mtls-size switch", rs6000_tls_size_string);
}
+/* Implement TARGET_OPTION_INIT_STRUCT. */
+
static void
-rs6000_option_optimization (int level ATTRIBUTE_UNUSED,
- int size ATTRIBUTE_UNUSED)
+rs6000_option_init_struct (struct gcc_options *opts)
{
if (DEFAULT_ABI == ABI_DARWIN)
/* The Darwin libraries never set errno, so we might as well
avoid calling them when that's the only reason we would. */
- flag_errno_math = 0;
+ opts->x_flag_errno_math = 0;
/* Enable section anchors by default. */
if (!TARGET_MACHO)
- flag_section_anchors = 2;
+ opts->x_flag_section_anchors = 2;
}
/* Implement TARGET_OPTION_DEFAULT_PARAMS. */
diff --git a/gcc/config/s390/s390.c b/gcc/config/s390/s390.c
index 8aabe1175e8..be26fbd6073 100644
--- a/gcc/config/s390/s390.c
+++ b/gcc/config/s390/s390.c
@@ -1503,15 +1503,21 @@ s390_option_optimization (int level ATTRIBUTE_UNUSED, int size)
/* ??? There are apparently still problems with -fcaller-saves. */
flag_caller_saves = 0;
- /* By default, always emit DWARF-2 unwind info. This allows debugging
- without maintaining a stack frame back-chain. */
- flag_asynchronous_unwind_tables = 1;
-
/* Use MVCLE instructions to decrease code size if requested. */
if (size != 0)
target_flags |= MASK_MVCLE;
}
+/* Implement TARGET_OPTION_INIT_STRUCT. */
+
+static void
+s390_option_init_struct (struct gcc_options *opts)
+{
+ /* By default, always emit DWARF-2 unwind info. This allows debugging
+ without maintaining a stack frame back-chain. */
+ opts->x_flag_asynchronous_unwind_tables = 1;
+}
+
/* Return true if ARG is the name of a processor. Set *TYPE and *FLAGS
to the associated processor_type and processor_flags if so. */
@@ -10507,6 +10513,9 @@ s390_loop_unroll_adjust (unsigned nunroll, struct loop *loop)
#undef TARGET_OPTION_OPTIMIZATION
#define TARGET_OPTION_OPTIMIZATION s390_option_optimization
+#undef TARGET_OPTION_INIT_STRUCT
+#define TARGET_OPTION_INIT_STRUCT s390_option_init_struct
+
#undef TARGET_ENCODE_SECTION_INFO
#define TARGET_ENCODE_SECTION_INFO s390_encode_section_info
diff --git a/gcc/config/sh/sh.c b/gcc/config/sh/sh.c
index 53b70ec83e8..41cc8b7a8a6 100644
--- a/gcc/config/sh/sh.c
+++ b/gcc/config/sh/sh.c
@@ -184,6 +184,7 @@ static rtx gen_block_redirect (rtx, int, int);
static void sh_reorg (void);
static void sh_option_override (void);
static void sh_option_optimization (int, int);
+static void sh_option_init_struct (struct gcc_options *);
static void sh_option_default_params (void);
static void output_stack_adjust (int, rtx, int, HARD_REG_SET *, bool);
static rtx frame_insn (rtx);
@@ -343,6 +344,8 @@ static const struct attribute_spec sh_attribute_table[] =
#define TARGET_OPTION_OVERRIDE sh_option_override
#undef TARGET_OPTION_OPTIMIZATION
#define TARGET_OPTION_OPTIMIZATION sh_option_optimization
+#undef TARGET_OPTION_INIT_STRUCT
+#define TARGET_OPTION_INIT_STRUCT sh_option_init_struct
#undef TARGET_OPTION_DEFAULT_PARAMS
#define TARGET_OPTION_DEFAULT_PARAMS sh_option_default_params
@@ -725,17 +728,23 @@ sh_option_optimization (int level, int size)
if (!size)
target_flags |= MASK_SAVE_ALL_TARGET_REGS;
}
- /* Likewise, we can't meaningfully test TARGET_SH2E / TARGET_IEEE
- here, so leave it to TARGET_OPTION_OVERRIDE to set
- flag_finite_math_only. We set it to 2 here so we know if the user
- explicitly requested this to be on or off. */
- flag_finite_math_only = 2;
/* If flag_schedule_insns is 1, we set it to 2 here so we know if
the user explicitly requested this to be on or off. */
if (flag_schedule_insns > 0)
flag_schedule_insns = 2;
}
+/* Implement TARGET_OPTION_INIT_STRUCT. */
+static void
+sh_option_init_struct (struct gcc_options *opts)
+{
+ /* We can't meaningfully test TARGET_SH2E / TARGET_IEEE
+ here, so leave it to TARGET_OPTION_OVERRIDE to set
+ flag_finite_math_only. We set it to 2 here so we know if the user
+ explicitly requested this to be on or off. */
+ opts->x_flag_finite_math_only = 2;
+}
+
/* Implement TARGET_OPTION_DEFAULT_PARAMS. */
static void
sh_option_default_params (void)
diff --git a/gcc/config/spu/spu.c b/gcc/config/spu/spu.c
index f9e5c82ea7a..254bd652bb0 100644
--- a/gcc/config/spu/spu.c
+++ b/gcc/config/spu/spu.c
@@ -150,7 +150,7 @@ char regs_ever_allocated[FIRST_PSEUDO_REGISTER];
/* Prototypes and external defs. */
static void spu_option_override (void);
-static void spu_option_optimization (int, int);
+static void spu_option_init_struct (struct gcc_options *opts);
static void spu_option_default_params (void);
static void spu_init_builtins (void);
static tree spu_builtin_decl (unsigned, bool);
@@ -480,8 +480,8 @@ static const struct attribute_spec spu_attribute_table[] =
#undef TARGET_OPTION_OVERRIDE
#define TARGET_OPTION_OVERRIDE spu_option_override
-#undef TARGET_OPTION_OPTIMIZATION
-#define TARGET_OPTION_OPTIMIZATION spu_option_optimization
+#undef TARGET_OPTION_INIT_STRUCT
+#define TARGET_OPTION_INIT_STRUCT spu_option_init_struct
#undef TARGET_OPTION_DEFAULT_PARAMS
#define TARGET_OPTION_DEFAULT_PARAMS spu_option_default_params
@@ -492,10 +492,10 @@ static const struct attribute_spec spu_attribute_table[] =
struct gcc_target targetm = TARGET_INITIALIZER;
static void
-spu_option_optimization (int level ATTRIBUTE_UNUSED, int size ATTRIBUTE_UNUSED)
+spu_option_init_struct (struct gcc_options *opts)
{
/* With so many registers this is better on by default. */
- flag_rename_registers = 1;
+ opts->x_flag_rename_registers = 1;
}
/* Implement TARGET_OPTION_DEFAULT_PARAMS. */