* target.def (target_option.optimization): New hook.
* doc/tm.texi.in (OPTIMIZATION_OPTIONS): Change to
TARGET_OPTION_OPTIMIZATION hook.
* doc/tm.texi: Regenerate.
* hooks.c (hook_void_int_int): New.
* hooks.h (hook_void_int_int): Declare.
* opts.c: Don't include tm_p.h.
(decode_options): Use targetm.target_option.optimization instead
of OPTIMIZATION_OPTIONS.
* system.h (OPTIMIZATION_OPTIONS): Poison.
* config/arm/arm-protos.h (arm_optimization_options): Remove.
* config/arm/arm.c (TARGET_OPTION_OPTIMIZATION): Define.
(arm_optimization_options): Rename to arm_option_optimization.
Make static.
* config/arm/arm.h (OPTIMIZATION_OPTIONS): Remove.
* config/cris/cris.c (TARGET_OPTION_OPTIMIZATION): Define.
(cris_option_optimization): New.
* config/cris/cris.h (OPTIMIZATION_OPTIONS): Remove.
* config/crx/crx.c (TARGET_OPTION_OPTIMIZATION): Define.
(crx_option_optimization): New.
* config/crx/crx.h (OPTIMIZATION_OPTIONS): Remove.
* config/frv/frv-protos.h (frv_optimization_options): Remove.
* config/frv/frv.c (TARGET_OPTION_OPTIMIZATION): Define.
(frv_optimization_options): Rename to frv_option_optimization.
Make static.
* config/frv/frv.h (OPTIMIZATION_OPTIONS): Remove.
* config/h8300/h8300.c (h8300_option_optimization): New.
(TARGET_OPTION_OPTIMIZATION): Define.
* config/h8300/h8300.h (OPTIMIZATION_OPTIONS): Remove.
* config/i386/i386-protos.h (optimization_options): Remove.
* config/i386/i386.c (optimization_options): Rename to
ix86_option_optimization. Make static.
(TARGET_OPTION_OPTIMIZATION): Define.
* config/i386/i386.h (OPTIMIZATION_OPTIONS): Remove.
* config/ia64/ia64-protos.h (ia64_optimization_options): Remove.
* config/ia64/ia64.c (TARGET_OPTION_OPTIMIZATION): Define.
(ia64_optimization_options): Rename to ia64_option_optimization.
Make static. Call SUBTARGET_OPTIMIZATION_OPTIONS.
* config/ia64/ia64.h (OPTIMIZATION_OPTIONS): Remove. Remove
commented-out definition.
* config/ia64/vms.h (SUBTARGET_OPTIMIZATION_OPTIONS): Define
instead of OPTIMIZATION_OPTIONS.
* config/m32r/m32r.c (TARGET_OPTION_OPTIMIZATION): Define.
(m32r_option_optimization): New.
* config/m32r/m32r.h (OPTIMIZATION_OPTIONS): Remove.
* config/m68hc11/m68hc11-protos.h (m68hc11_optimization_options):
Remove.
* config/mcore/mcore.c (TARGET_OPTION_OPTIMIZATION): Define.
(mcore_option_optimization): New.
* config/mcore/mcore.h (OPTIMIZATION_OPTIONS): Remove.
* config/mep/mep-protos.h (mep_optimization_options): Remove.
* config/mep/mep.c (TARGET_OPTION_OPTIMIZATION): Define.
(mep_optimization_options): Rename to mep_option_optimization.
Make static. Take unused level and size parameters.
* config/mep/mep.h (OPTIMIZATION_OPTIONS): Remove.
* config/mmix/mmix.c (TARGET_OPTION_OPTIMIZATION): Define.
(mmix_option_optimization): New.
* config/mmix/mmix.h (OPTIMIZATION_OPTIONS): Remove.
* config/pdp11/pdp11.c (TARGET_OPTION_OPTIMIZATION): Define.
(pdp11_option_optimization): New.
* config/pdp11/pdp11.h (OPTIMIZATION_OPTIONS): Remove.
* config/rs6000/rs6000-protos.h (optimization_options): Remove.
* config/rs6000/rs6000.c (TARGET_OPTION_OPTIMIZATION): Define.
(optimization_options): Rename to rs6000_option_optimization.
Make static.
* config/rs6000/rs6000.h (OPTIMIZATION_OPTIONS): Remove.
* config/rx/rx-protos.h (rx_set_optimization_options): Remove.
* config/rx/rx.c (rx_set_optimization_options): Rename to
rx_option_optimization. Make static. Take unused level and size
parameters.
(TARGET_OPTION_OPTIMIZATION): Define.
* config/rx/rx.h (OPTIMIZATION_OPTIONS): Remove.
* config/s390/s390-protos.h (optimization_options): Remove.
* config/s390/s390.c (optimization_options): Rename to
s390_option_optimization. Make static. Don't mark size parameter
unused.
(TARGET_OPTION_OPTIMIZATION): Define.
* config/s390/s390.h (OPTIMIZATION_OPTIONS): Remove.
* config/sh/sh-protos.h (sh_optimization_options): Remove.
* config/sh/sh.c (TARGET_OPTION_OPTIMIZATION): Define.
(sh_optimization_options): Rename to sh_option_optimization. Make
static. Don't mark parameters unused.
* config/sh/sh.h (OPTIMIZATION_OPTIONS): Remove.
* config/spu/spu-protos.h (spu_optimization_options): Remove.
* config/spu/spu.c (TARGET_OPTION_OPTIMIZATION): Define.
(spu_optimization_options): Rename to spu_option_optimization.
Make static.
* config/spu/spu.h (OPTIMIZATION_OPTIONS): Remove.
* config/v850/v850.c (TARGET_OPTION_OPTIMIZATION): Define.
(v850_option_optimization): New.
* config/v850/v850.h (OPTIMIZATION_OPTIONS): Remove.
* config/xtensa/xtensa.c (TARGET_OPTION_OPTIMIZATION): Define.
(xtensa_option_optimization): New.
* config/xtensa/xtensa.h (OPTIMIZATION_OPTIONS): Remove.
From-SVN: r164335
+2010-09-16 Joseph Myers <joseph@codesourcery.com>
+
+ * target.def (target_option.optimization): New hook.
+ * doc/tm.texi.in (OPTIMIZATION_OPTIONS): Change to
+ TARGET_OPTION_OPTIMIZATION hook.
+ * doc/tm.texi: Regenerate.
+ * hooks.c (hook_void_int_int): New.
+ * hooks.h (hook_void_int_int): Declare.
+ * opts.c: Don't include tm_p.h.
+ (decode_options): Use targetm.target_option.optimization instead
+ of OPTIMIZATION_OPTIONS.
+ * system.h (OPTIMIZATION_OPTIONS): Poison.
+ * config/arm/arm-protos.h (arm_optimization_options): Remove.
+ * config/arm/arm.c (TARGET_OPTION_OPTIMIZATION): Define.
+ (arm_optimization_options): Rename to arm_option_optimization.
+ Make static.
+ * config/arm/arm.h (OPTIMIZATION_OPTIONS): Remove.
+ * config/cris/cris.c (TARGET_OPTION_OPTIMIZATION): Define.
+ (cris_option_optimization): New.
+ * config/cris/cris.h (OPTIMIZATION_OPTIONS): Remove.
+ * config/crx/crx.c (TARGET_OPTION_OPTIMIZATION): Define.
+ (crx_option_optimization): New.
+ * config/crx/crx.h (OPTIMIZATION_OPTIONS): Remove.
+ * config/frv/frv-protos.h (frv_optimization_options): Remove.
+ * config/frv/frv.c (TARGET_OPTION_OPTIMIZATION): Define.
+ (frv_optimization_options): Rename to frv_option_optimization.
+ Make static.
+ * config/frv/frv.h (OPTIMIZATION_OPTIONS): Remove.
+ * config/h8300/h8300.c (h8300_option_optimization): New.
+ (TARGET_OPTION_OPTIMIZATION): Define.
+ * config/h8300/h8300.h (OPTIMIZATION_OPTIONS): Remove.
+ * config/i386/i386-protos.h (optimization_options): Remove.
+ * config/i386/i386.c (optimization_options): Rename to
+ ix86_option_optimization. Make static.
+ (TARGET_OPTION_OPTIMIZATION): Define.
+ * config/i386/i386.h (OPTIMIZATION_OPTIONS): Remove.
+ * config/ia64/ia64-protos.h (ia64_optimization_options): Remove.
+ * config/ia64/ia64.c (TARGET_OPTION_OPTIMIZATION): Define.
+ (ia64_optimization_options): Rename to ia64_option_optimization.
+ Make static. Call SUBTARGET_OPTIMIZATION_OPTIONS.
+ * config/ia64/ia64.h (OPTIMIZATION_OPTIONS): Remove. Remove
+ commented-out definition.
+ * config/ia64/vms.h (SUBTARGET_OPTIMIZATION_OPTIONS): Define
+ instead of OPTIMIZATION_OPTIONS.
+ * config/m32r/m32r.c (TARGET_OPTION_OPTIMIZATION): Define.
+ (m32r_option_optimization): New.
+ * config/m32r/m32r.h (OPTIMIZATION_OPTIONS): Remove.
+ * config/m68hc11/m68hc11-protos.h (m68hc11_optimization_options):
+ Remove.
+ * config/mcore/mcore.c (TARGET_OPTION_OPTIMIZATION): Define.
+ (mcore_option_optimization): New.
+ * config/mcore/mcore.h (OPTIMIZATION_OPTIONS): Remove.
+ * config/mep/mep-protos.h (mep_optimization_options): Remove.
+ * config/mep/mep.c (TARGET_OPTION_OPTIMIZATION): Define.
+ (mep_optimization_options): Rename to mep_option_optimization.
+ Make static. Take unused level and size parameters.
+ * config/mep/mep.h (OPTIMIZATION_OPTIONS): Remove.
+ * config/mmix/mmix.c (TARGET_OPTION_OPTIMIZATION): Define.
+ (mmix_option_optimization): New.
+ * config/mmix/mmix.h (OPTIMIZATION_OPTIONS): Remove.
+ * config/pdp11/pdp11.c (TARGET_OPTION_OPTIMIZATION): Define.
+ (pdp11_option_optimization): New.
+ * config/pdp11/pdp11.h (OPTIMIZATION_OPTIONS): Remove.
+ * config/rs6000/rs6000-protos.h (optimization_options): Remove.
+ * config/rs6000/rs6000.c (TARGET_OPTION_OPTIMIZATION): Define.
+ (optimization_options): Rename to rs6000_option_optimization.
+ Make static.
+ * config/rs6000/rs6000.h (OPTIMIZATION_OPTIONS): Remove.
+ * config/rx/rx-protos.h (rx_set_optimization_options): Remove.
+ * config/rx/rx.c (rx_set_optimization_options): Rename to
+ rx_option_optimization. Make static. Take unused level and size
+ parameters.
+ (TARGET_OPTION_OPTIMIZATION): Define.
+ * config/rx/rx.h (OPTIMIZATION_OPTIONS): Remove.
+ * config/s390/s390-protos.h (optimization_options): Remove.
+ * config/s390/s390.c (optimization_options): Rename to
+ s390_option_optimization. Make static. Don't mark size parameter
+ unused.
+ (TARGET_OPTION_OPTIMIZATION): Define.
+ * config/s390/s390.h (OPTIMIZATION_OPTIONS): Remove.
+ * config/sh/sh-protos.h (sh_optimization_options): Remove.
+ * config/sh/sh.c (TARGET_OPTION_OPTIMIZATION): Define.
+ (sh_optimization_options): Rename to sh_option_optimization. Make
+ static. Don't mark parameters unused.
+ * config/sh/sh.h (OPTIMIZATION_OPTIONS): Remove.
+ * config/spu/spu-protos.h (spu_optimization_options): Remove.
+ * config/spu/spu.c (TARGET_OPTION_OPTIMIZATION): Define.
+ (spu_optimization_options): Rename to spu_option_optimization.
+ Make static.
+ * config/spu/spu.h (OPTIMIZATION_OPTIONS): Remove.
+ * config/v850/v850.c (TARGET_OPTION_OPTIMIZATION): Define.
+ (v850_option_optimization): New.
+ * config/v850/v850.h (OPTIMIZATION_OPTIONS): Remove.
+ * config/xtensa/xtensa.c (TARGET_OPTION_OPTIMIZATION): Define.
+ (xtensa_option_optimization): New.
+ * config/xtensa/xtensa.h (OPTIMIZATION_OPTIONS): Remove.
+
2010-09-16 Joseph Myers <joseph@codesourcery.com>
* doc/tm.texi.in (OVERRIDE_OPTIONS): Remove documentation.
#ifndef GCC_ARM_PROTOS_H
#define GCC_ARM_PROTOS_H
-extern void arm_optimization_options (int, int);
extern int use_return_insn (int, rtx);
extern enum reg_class arm_regno_class (int);
extern void arm_load_pic_register (unsigned long);
static void arm_expand_builtin_va_start (tree, rtx);
static tree arm_gimplify_va_arg_expr (tree, tree, gimple_seq *, gimple_seq *);
static void arm_option_override (void);
+static void arm_option_optimization (int, int);
static bool arm_handle_option (size_t, const char *, int);
static void arm_target_help (void);
static unsigned HOST_WIDE_INT arm_shift_truncation_mask (enum machine_mode);
#define TARGET_HELP arm_target_help
#undef TARGET_OPTION_OVERRIDE
#define TARGET_OPTION_OVERRIDE arm_option_override
+#undef TARGET_OPTION_OPTIMIZATION
+#define TARGET_OPTION_OPTIMIZATION arm_option_optimization
#undef TARGET_COMP_TYPE_ATTRIBUTES
#define TARGET_COMP_TYPE_ATTRIBUTES arm_comp_type_attributes
}
/* Set default optimization options. */
-void
-arm_optimization_options (int level, int size ATTRIBUTE_UNUSED)
+static void
+arm_option_optimization (int level, int size ATTRIBUTE_UNUSED)
{
/* Enable section anchors by default at -O1 or higher.
Use 2 to distinguish from an explicit -fsection-anchors
that is controlled by the APCS-FRAME option. */
#define CAN_DEBUG_WITHOUT_FP
-#define OPTIMIZATION_OPTIONS(LEVEL,SIZE) \
- arm_optimization_options ((LEVEL), (SIZE))
-
/* Nonzero if PIC code requires explicit qualifiers to generate
PLT and GOT relocs rather than the assembler doing so implicitly.
Subtargets can override these if required. */
static tree cris_md_asm_clobbers (tree, tree, tree);
static bool cris_handle_option (size_t, const char *, int);
+static void cris_option_optimization (int, int);
static void cris_option_override (void);
static bool cris_frame_pointer_required (void);
#undef TARGET_OPTION_OVERRIDE
#define TARGET_OPTION_OVERRIDE cris_option_override
+#undef TARGET_OPTION_OPTIMIZATION
+#define TARGET_OPTION_OPTIMIZATION cris_option_optimization
#undef TARGET_ASM_TRAMPOLINE_TEMPLATE
#define TARGET_ASM_TRAMPOLINE_TEMPLATE cris_asm_trampoline_template
return true;
}
+/* Implement TARGET_OPTION_OPTIMIZATION. */
+
+static void
+cris_option_optimization (int level, int size)
+{
+ if (level >= 2 || size)
+ flag_omit_frame_pointer = 1;
+}
+
/* The TARGET_OPTION_OVERRIDE worker.
As is the norm, this also parses -mfoo=bar type parameters. */
#define CRIS_SUBTARGET_HANDLE_OPTION(x, y, z)
-#define OPTIMIZATION_OPTIONS(OPTIMIZE, SIZE) \
- do \
- { \
- if ((OPTIMIZE) >= 2 || (SIZE)) \
- flag_omit_frame_pointer = 1; \
- } \
- while (0)
-
-
/* Node: Storage Layout */
#define BITS_BIG_ENDIAN 0
/* Output routines for GCC for CRX.
Copyright (C) 1991, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001,
- 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009
+ 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010
Free Software Foundation, Inc.
This file is part of GCC.
static int crx_address_cost (rtx, bool);
static bool crx_legitimate_address_p (enum machine_mode, rtx, bool);
static bool crx_can_eliminate (const int, const int);
+static void crx_option_optimization (int, int);
/*****************************************************************************/
/* RTL VALIDITY */
{NULL, 0, 0, false, false, false, NULL}
};
+/* Option handling. */
+
+#undef TARGET_OPTION_OPTIMIZATION
+#define TARGET_OPTION_OPTIMIZATION crx_option_optimization
/* Initialize 'targetm' variable which contains pointers to functions and data
* relating to the target machine. */
else
emit_jump_insn (gen_pop_and_popret_return (GEN_INT (sum_regs)));
}
+
+/* Implement TARGET_OPTION_OPTIMIZATION. */
+static void
+crx_option_optimization (int level, int size)
+{
+ /* Put each function in its own section so that PAGE-instruction
+ relaxation can do its best. */
+ if (level || size)
+ flag_function_sections = 1;
+}
/* Definitions of target machine for GNU compiler, for CRX.
Copyright (C) 1991, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000,
- 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009
+ 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010
Free Software Foundation, Inc.
This file is part of GCC.
#define TARGET_VERSION fputs (" (CRX/ELF)", stderr);
-/* Put each function in its own section so that PAGE-instruction
- * relaxation can do its best. */
-#define OPTIMIZATION_OPTIONS(LEVEL, SIZEFLAG) \
- do { \
- if ((LEVEL) || (SIZEFLAG)) \
- flag_function_sections = 1; \
- } while (0)
-
/* Show we can debug even without a frame pointer. */
#define CAN_DEBUG_WITHOUT_FP
/* Define functions defined in frv.c */
extern void frv_expand_prologue (void);
extern void frv_expand_epilogue (bool);
-extern void frv_optimization_options (int, int);
extern void frv_conditional_register_usage (void);
extern frv_stack_t *frv_stack_info (void);
extern void frv_debug_stack (frv_stack_t *);
static bool frv_handle_option (size_t, const char *, int);
static void frv_option_override (void);
+static void frv_option_optimization (int, int);
static bool frv_legitimate_address_p (enum machine_mode, rtx, bool);
static int frv_default_flags_for_cpu (void);
static int frv_string_begins_with (const_tree, const char *);
#define TARGET_HANDLE_OPTION frv_handle_option
#undef TARGET_OPTION_OVERRIDE
#define TARGET_OPTION_OVERRIDE frv_option_override
+#undef TARGET_OPTION_OPTIMIZATION
+#define TARGET_OPTION_OPTIMIZATION frv_option_optimization
#undef TARGET_INIT_BUILTINS
#define TARGET_INIT_BUILTINS frv_init_builtins
#undef TARGET_EXPAND_BUILTIN
}
\f
-/* Some machines may desire to change what optimizations are performed for
- various optimization levels. This macro, if defined, is executed once just
- after the optimization level is determined and before the remainder of the
- command options have been parsed. Values set in this macro are used as the
- default values for the other command line options.
+/* Implement TARGET_OPTION_OPTIMIZATION.
- LEVEL is the optimization level specified; 2 if `-O2' is specified, 1 if
- `-O' is specified, and 0 if neither is specified.
-
- SIZE is nonzero if `-Os' is specified, 0 otherwise.
-
- You should not use this macro to change options that are not
- machine-specific. These should uniformly selected by the same optimization
- level on all supported machines. Use this macro to enable machine-specific
- optimizations.
-
- *Do not examine `write_symbols' in this macro!* The debugging options are
- *not supposed to alter the generated code. */
-
-/* On the FRV, possibly disable VLIW packing which is done by the 2nd
+ On the FRV, possibly disable VLIW packing which is done by the 2nd
scheduling pass at the current time. */
-void
-frv_optimization_options (int level, int size ATTRIBUTE_UNUSED)
+static void
+frv_option_optimization (int level, int size ATTRIBUTE_UNUSED)
{
if (level >= 2)
{
#endif */
#define TARGET_VERSION fprintf (stderr, _(" (frv)"))
-/* Some machines may desire to change what optimizations are performed for
- various optimization levels. This macro, if defined, is executed once just
- after the optimization level is determined and before the remainder of the
- command options have been parsed. Values set in this macro are used as the
- default values for the other command line options.
-
- LEVEL is the optimization level specified; 2 if `-O2' is specified, 1 if
- `-O' is specified, and 0 if neither is specified.
-
- SIZE is nonzero if `-Os' is specified, 0 otherwise.
-
- You should not use this macro to change options that are not
- machine-specific. These should uniformly selected by the same optimization
- level on all supported machines. Use this macro to enable machine-specific
- optimizations.
-
- *Do not examine `write_symbols' in this macro!* The debugging options are
- *not supposed to alter the generated code. */
-#define OPTIMIZATION_OPTIONS(LEVEL,SIZE) frv_optimization_options (LEVEL, SIZE)
-
-
/* Define this macro if debugging can be performed even without a frame
pointer. If this macro is defined, GCC will turn on the
`-fomit-frame-pointer' option whenever `-O' is specified. */
H8_S
};
+/* Implement TARGET_OPTION_OPTIMIZATION. */
+
+static void
+h8300_option_optimization (int level ATTRIBUTE_UNUSED,
+ int size ATTRIBUTE_UNUSED)
+{
+ /* Basic block reordering is only beneficial on targets with cache
+ and/or variable-cycle branches where (cycle count taken != cycle
+ count not taken). */
+ flag_reorder_blocks = 0;
+}
+
/* Initialize various cpu specific globals at start up. */
static void
#undef TARGET_OPTION_OVERRIDE
#define TARGET_OPTION_OVERRIDE h8300_option_override
+#undef TARGET_OPTION_OPTIMIZATION
+#define TARGET_OPTION_OPTIMIZATION h8300_option_optimization
+
struct gcc_target targetm = TARGET_INITIALIZER;
#define LIB_SPEC "%{mrelax:-relax} %{g:-lg} %{!p:%{!pg:-lc}}%{p:-lc_p}%{pg:-lc_p}"
-#define OPTIMIZATION_OPTIONS(LEVEL, SIZE) \
- do \
- { \
- /* Basic block reordering is only beneficial on targets with cache \
- and/or variable-cycle branches where (cycle count taken != \
- cycle count not taken). */ \
- flag_reorder_blocks = 0; \
- } \
- while (0)
-
/* Print subsidiary information on the compiler version in use. */
#define TARGET_VERSION fprintf (stderr, " (Renesas H8/300)");
<http://www.gnu.org/licenses/>. */
/* Functions in i386.c */
-extern void optimization_options (int, int);
extern void ix86_conditional_register_usage (void);
extern bool ix86_target_stack_probe (void);
ASM_OUTPUT_SKIP (file, size ? size : 1);
}
\f
-void
-optimization_options (int level, int size ATTRIBUTE_UNUSED)
+static void
+ix86_option_optimization (int level, int size ATTRIBUTE_UNUSED)
{
/* For -O2 and beyond, turn off -fschedule-insns by default. It tends to
make the problem with not enough registers even worse. */
#undef TARGET_OPTION_OVERRIDE
#define TARGET_OPTION_OVERRIDE ix86_option_override
+#undef TARGET_OPTION_OPTIMIZATION
+#define TARGET_OPTION_OPTIMIZATION ix86_option_optimization
#undef TARGET_REGISTER_MOVE_COST
#define TARGET_REGISTER_MOVE_COST ix86_register_move_cost
with the rounding mode forced to 53 bits. */
#define TARGET_96_ROUND_53_LONG_DOUBLE 0
-/* Define this to change the optimizations performed by default. */
-#define OPTIMIZATION_OPTIONS(LEVEL, SIZE) \
- optimization_options ((LEVEL), (SIZE))
-
/* -march=native handling only makes sense with compiler running on
an x86 or x86_64 chip. If changing this condition, also change
the condition in driver-i386.c. */
extern void ia64_output_function_profiler (FILE *, int);
extern void ia64_profile_hook (int);
-extern void ia64_optimization_options (int, int);
extern void ia64_init_expanders (void);
extern rtx ia64_dconst_0_5 (void);
static rtx gen_fr_restore_x (rtx, rtx, rtx);
static void ia64_option_override (void);
+static void ia64_option_optimization (int, int);
static bool ia64_can_eliminate (const int, const int);
static enum machine_mode hfa_element_mode (const_tree, bool);
static void ia64_setup_incoming_varargs (CUMULATIVE_ARGS *, enum machine_mode,
#undef TARGET_OPTION_OVERRIDE
#define TARGET_OPTION_OVERRIDE ia64_option_override
+#undef TARGET_OPTION_OPTIMIZATION
+#define TARGET_OPTION_OPTIMIZATION ia64_option_optimization
#undef TARGET_ASM_FUNCTION_PROLOGUE
#define TARGET_ASM_FUNCTION_PROLOGUE ia64_output_function_prologue
}
/* Implement overriding of the optimization options. */
-void
-ia64_optimization_options (int level ATTRIBUTE_UNUSED,
- int size ATTRIBUTE_UNUSED)
+static void
+ia64_option_optimization (int level ATTRIBUTE_UNUSED,
+ int size ATTRIBUTE_UNUSED)
{
+#ifdef SUBTARGET_OPTIMIZATION_OPTIONS
+ SUBTARGET_OPTIMIZATION_OPTIONS;
+#endif
+
/* Let the scheduler form additional regions. */
set_param_value ("max-sched-extend-regions-iters", 2);
};
extern enum processor_type ia64_tune;
-
-/* Some machines may desire to change what optimizations are performed for
- various optimization levels. This macro, if defined, is executed once just
- after the optimization level is determined and before the remainder of the
- command options have been parsed. Values set in this macro are used as the
- default values for the other command line options. */
-
-/* #define OPTIMIZATION_OPTIONS(LEVEL,SIZE) */
\f
/* Driver configuration */
/* Switch on code for querying unit reservations. */
#define CPU_UNITS_QUERY 1
-/* Define this to change the optimizations performed by default. */
-#define OPTIMIZATION_OPTIONS(LEVEL, SIZE) \
- ia64_optimization_options ((LEVEL), (SIZE))
-
/* End of ia64.h */
} \
} while (0)
-#undef OPTIMIZATION_OPTIONS
-#define OPTIMIZATION_OPTIONS(LEVEL,SIZE) \
+#undef SUBTARGET_OPTIMIZATION_OPTIONS
+#define SUBTARGET_OPTIMIZATION_OPTIONS \
do { \
flag_merge_constants = 0; \
- ia64_optimization_options ((LEVEL), (SIZE)); \
} while (0)
/* Define this to be nonzero if static stack checking is supported. */
/* Forward declaration. */
static bool m32r_handle_option (size_t, const char *, int);
static void m32r_option_override (void);
+static void m32r_option_optimization (int, int);
static void init_reg_tables (void);
static void block_move_call (rtx, rtx, rtx);
static int m32r_is_insn (rtx);
#define TARGET_HANDLE_OPTION m32r_handle_option
#undef TARGET_OPTION_OVERRIDE
#define TARGET_OPTION_OVERRIDE m32r_option_override
+#undef TARGET_OPTION_OPTIMIZATION
+#define TARGET_OPTION_OPTIMIZATION m32r_option_optimization
#undef TARGET_ENCODE_SECTION_INFO
#define TARGET_ENCODE_SECTION_INFO m32r_encode_section_info
SUBTARGET_OVERRIDE_OPTIONS;
}
+static void
+m32r_option_optimization (int level, int size)
+{
+ if (level == 1)
+ flag_regmove = 1;
+
+ if (size)
+ flag_omit_frame_pointer = 1;
+
+ SUBTARGET_OPTIMIZATION_OPTIONS;
+}
+
/* Vectors to keep interesting information about registers where it can easily
be got. We use to use the actual mode value as the bit number, but there
is (or may be) more than 32 modes now. Instead we use two tables: one
#define SUBTARGET_OPTIMIZATION_OPTIONS
#endif
-#define OPTIMIZATION_OPTIONS(LEVEL, SIZE) \
- do \
- { \
- if (LEVEL == 1) \
- flag_regmove = TRUE; \
- \
- if (SIZE) \
- { \
- flag_omit_frame_pointer = TRUE; \
- } \
- \
- SUBTARGET_OPTIMIZATION_OPTIONS \
- } \
- while (0)
-
/* Define this macro if debugging can be performed even without a
frame pointer. If this macro is defined, GCC will turn on the
`-fomit-frame-pointer' option whenever `-O' is specified. */
<http://www.gnu.org/licenses/>. */
-extern int m68hc11_optimization_options (int,int);
extern void m68hc11_conditional_register_usage (void);
extern int hard_regno_mode_ok (int, enum machine_mode);
extern int m68hc11_hard_regno_rename_ok (int, int);
static void mcore_asm_trampoline_template (FILE *);
static void mcore_trampoline_init (rtx, tree, rtx);
static void mcore_option_override (void);
+static void mcore_option_optimization (int, int);
\f
/* MCore specific attributes. */
#undef TARGET_OPTION_OVERRIDE
#define TARGET_OPTION_OVERRIDE mcore_option_override
+#undef TARGET_OPTION_OPTIMIZATION
+#define TARGET_OPTION_OPTIMIZATION mcore_option_optimization
struct gcc_target targetm = TARGET_INITIALIZER;
\f
if (TARGET_LITTLE_END && ! TARGET_M340)
target_flags |= MASK_M340;
}
+
+/* What options are we going to default to specific settings when
+ -O* happens; the user can subsequently override these settings.
+
+ Omitting the frame pointer is a very good idea on the MCore.
+ Scheduling isn't worth anything on the current MCore implementation. */
+
+static void
+mcore_option_optimization (int level, int size)
+{
+ if (level)
+ {
+ flag_no_function_cse = 1;
+ flag_omit_frame_pointer = 1;
+
+ if (level >= 2)
+ {
+ flag_caller_saves = 0;
+ flag_schedule_insns = 0;
+ flag_schedule_insns_after_reload = 0;
+ }
+ }
+ if (size)
+ {
+ target_flags &= ~MASK_HARDLIT;
+ }
+}
+
\f
/* Compute the number of word sized registers needed to
hold a function argument of mode MODE and type TYPE. */
/* The MCore ABI says that bitfields are unsigned by default. */
#define CC1_SPEC "-funsigned-bitfields"
-/* What options are we going to default to specific settings when
- -O* happens; the user can subsequently override these settings.
-
- Omitting the frame pointer is a very good idea on the MCore.
- Scheduling isn't worth anything on the current MCore implementation. */
-#define OPTIMIZATION_OPTIONS(LEVEL,SIZE) \
-{ \
- if (LEVEL) \
- { \
- flag_no_function_cse = 1; \
- flag_omit_frame_pointer = 1; \
- \
- if (LEVEL >= 2) \
- { \
- flag_caller_saves = 0; \
- flag_schedule_insns = 0; \
- flag_schedule_insns_after_reload = 0; \
- } \
- } \
- if (SIZE) \
- { \
- target_flags &= ~MASK_HARDLIT; \
- } \
-}
-
/* Target machine storage Layout. */
#define PROMOTE_MODE(MODE,UNSIGNEDP,TYPE) \
<http://www.gnu.org/licenses/>. */
extern void mep_conditional_register_usage (void);
-extern void mep_optimization_options (void);
extern int mep_regno_reg_class (int);
extern int mep_reg_class_from_constraint (int, const char *);
extern bool mep_const_ok_for_letter_p (HOST_WIDE_INT, int);
global_regs[i] = 1;
}
-void
-mep_optimization_options (void)
+static void
+mep_option_optimization (int level ATTRIBUTE_UNUSED, int size ATTRIBUTE_UNUSED)
{
/* The first scheduling pass often increases register pressure and tends
to result in more spill code. Only run it when specifically asked. */
#define TARGET_HANDLE_OPTION mep_handle_option
#undef TARGET_OPTION_OVERRIDE
#define TARGET_OPTION_OVERRIDE mep_option_override
+#undef TARGET_OPTION_OPTIMIZATION
+#define TARGET_OPTION_OPTIMIZATION mep_option_optimization
#undef TARGET_DEFAULT_TARGET_FLAGS
#define TARGET_DEFAULT_TARGET_FLAGS TARGET_DEFAULT
#undef TARGET_ALLOCATE_INITIAL_VALUE
/* end-coproc-selection-table */
#define CAN_DEBUG_WITHOUT_FP
-
-#define OPTIMIZATION_OPTIONS(LEVEL, FOR_SIZE) mep_optimization_options ()
\f
#define BITS_BIG_ENDIAN 0
static int mmix_output_destination_register;
static void mmix_option_override (void);
+static void mmix_option_optimization (int, int);
static void mmix_asm_output_source_filename (FILE *, const char *);
static void mmix_output_shiftvalue_op_from_str
(FILE *, const char *, HOST_WIDEST_INT);
#undef TARGET_OPTION_OVERRIDE
#define TARGET_OPTION_OVERRIDE mmix_option_override
+#undef TARGET_OPTION_OPTIMIZATION
+#define TARGET_OPTION_OPTIMIZATION mmix_option_optimization
struct gcc_target targetm = TARGET_INITIALIZER;
}
}
+/* TARGET_OPTION_OPTIMIZATION. */
+
+static void
+mmix_option_optimization (int level, int size)
+{
+ if (level >= 1)
+ flag_regmove = 1;
+
+ if (size || level > 1)
+ flag_omit_frame_pointer = 1;
+}
+
/* INIT_EXPANDERS. */
void
#define TARGET_VERSION \
fprintf (stderr, " (MMIX)")
-#define OPTIMIZATION_OPTIONS(LEVEL, SIZE) \
- do \
- { \
- if (LEVEL >= 1) \
- flag_regmove = TRUE; \
- \
- if (SIZE || LEVEL > 1) \
- { \
- flag_omit_frame_pointer = TRUE; \
- } \
- } \
- while (0)
-
/* This one will have to wait a little bit; right now we can't debug
neither with or without a frame-pointer. */
/* #define CAN_DEBUG_WITHOUT_FP */
/* rtx cc0_reg_rtx; - no longer needed? */
static bool pdp11_handle_option (size_t, const char *, int);
+static void pdp11_option_optimization (int, int);
static rtx find_addr_reg (rtx);
static const char *singlemove_string (rtx *);
static bool pdp11_assemble_integer (rtx, unsigned int, int);
(MASK_FPU | MASK_45 | MASK_ABSHI_BUILTIN | TARGET_UNIX_ASM_DEFAULT)
#undef TARGET_HANDLE_OPTION
#define TARGET_HANDLE_OPTION pdp11_handle_option
+#undef TARGET_OPTION_OPTIMIZATION
+#define TARGET_OPTION_OPTIMIZATION pdp11_option_optimization
#undef TARGET_RTX_COSTS
#define TARGET_RTX_COSTS pdp11_rtx_costs
}
}
+/* Implement TARGET_OPTION_OPTIMIZATION. */
+
+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;
+ /* flag_unroll_loops = 1; */
+ }
+}
+
/* Nonzero if OP is a valid second operand for an arithmetic insn. */
int
#define TRAMPOLINE_SIZE 8
#define TRAMPOLINE_ALIGNMENT 16
-/* Some machines may desire to change what optimizations are
- performed for various optimization levels. This macro, if
- defined, is executed once just after the optimization level is
- determined and before the remainder of the command options have
- been parsed. Values set in this macro are used as the default
- values for the other command line options.
-
- LEVEL is the optimization level specified; 2 if -O2 is
- specified, 1 if -O is specified, and 0 if neither is specified. */
-
-#define OPTIMIZATION_OPTIONS(LEVEL,SIZE) \
-{ \
- flag_finite_math_only = 0; \
- flag_trapping_math = 0; \
- flag_signaling_nans = 0; \
- if (LEVEL >= 3) \
- { \
- flag_omit_frame_pointer = 1; \
- /* flag_unroll_loops = 1; */ \
- } \
-}
-
/* there is no point in avoiding branches on a pdp,
since branches are really cheap - I just want to find out
how much difference the BRANCH_COST macro makes in code */
#endif /* TREE_CODE */
-extern void optimization_options (int, int);
extern int direct_return (void);
extern int first_reg_to_save (void);
extern int first_fp_reg_to_save (void);
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 bool rs6000_handle_option (size_t, const char *, int);
static void rs6000_parse_tls_size_option (void);
static void rs6000_parse_yes_no_option (const char *, const char *, int *);
#undef TARGET_OPTION_OVERRIDE
#define TARGET_OPTION_OVERRIDE rs6000_option_override
+#undef TARGET_OPTION_OPTIMIZATION
+#define TARGET_OPTION_OPTIMIZATION rs6000_option_optimization
+
#undef TARGET_VECTORIZE_BUILTIN_VECTORIZED_FUNCTION
#define TARGET_VECTORIZE_BUILTIN_VECTORIZED_FUNCTION \
rs6000_builtin_vectorized_function
error ("bad value %qs for -mtls-size switch", rs6000_tls_size_string);
}
-void
-optimization_options (int level ATTRIBUTE_UNUSED, int size ATTRIBUTE_UNUSED)
+static void
+rs6000_option_optimization (int level ATTRIBUTE_UNUSED,
+ int size ATTRIBUTE_UNUSED)
{
if (DEFAULT_ABI == ABI_DARWIN)
/* The Darwin libraries never set errno, so we might as well
/* The default CPU for TARGET_OPTION_OVERRIDE. */
#define OPTION_TARGET_CPU_DEFAULT TARGET_CPU_DEFAULT
-/* Define this to change the optimizations performed by default. */
-#define OPTIMIZATION_OPTIONS(LEVEL,SIZE) optimization_options(LEVEL,SIZE)
-
/* Show we can debug even without a frame pointer. */
#define CAN_DEBUG_WITHOUT_FP
extern void rx_conditional_register_usage (void);
extern void rx_expand_prologue (void);
extern int rx_initial_elimination_offset (int, int);
-extern void rx_set_optimization_options (void);
#ifdef RTX_CODE
extern bool rx_compare_redundant (rtx);
return true;
}
-void
-rx_set_optimization_options (void)
+/* Implement TARGET_OPTION_OPTIMIZATION. */
+
+static void
+rx_option_optimization (int level ATTRIBUTE_UNUSED, int size ATTRIBUTE_UNUSED)
{
static bool first_time = TRUE;
static bool saved_allow_rx_fpu = TRUE;
#undef TARGET_OPTION_OVERRIDE
#define TARGET_OPTION_OVERRIDE rx_option_override
+#undef TARGET_OPTION_OPTIMIZATION
+#define TARGET_OPTION_OPTIMIZATION rx_option_optimization
+
struct gcc_target targetm = TARGET_INITIALIZER;
/* #include "gt-rx.h" */
#define TARGET_OPTION_TRANSLATE_TABLE \
{"-nofpu", "-mnofpu" }
-#define OPTIMIZATION_OPTIONS(LEVEL,SIZE) \
- rx_set_optimization_options ()
-
#define TARGET_USE_FPU (! TARGET_NO_USE_FPU)
/* This macro is used to decide when RX FPU instructions can be used. */
/* Declare functions in s390.c. */
-extern void optimization_options (int, int);
extern HOST_WIDE_INT s390_initial_elimination_offset (int, int);
extern void s390_emit_prologue (void);
extern void s390_emit_epilogue (bool);
SIZE is nonzero if `-Os' is specified and zero otherwise. */
-void
-optimization_options (int level ATTRIBUTE_UNUSED, int size ATTRIBUTE_UNUSED)
+static void
+s390_option_optimization (int level ATTRIBUTE_UNUSED, int size)
{
/* ??? There are apparently still problems with -fcaller-saves. */
flag_caller_saves = 0;
if (!PARAM_SET_P (PARAM_SIMULTANEOUS_PREFETCHES))
set_param_value ("simultaneous-prefetches", 6);
- /* This cannot reside in optimization_options since HAVE_prefetch
+ /* This cannot reside in s390_option_optimization since HAVE_prefetch
requires the arch flags to be evaluated already. Since prefetching
is beneficial on s390, we enable it if available. */
if (flag_prefetch_loop_arrays < 0 && HAVE_prefetch && optimize >= 3)
#undef TARGET_OPTION_OVERRIDE
#define TARGET_OPTION_OVERRIDE s390_option_override
+#undef TARGET_OPTION_OPTIMIZATION
+#define TARGET_OPTION_OPTIMIZATION s390_option_optimization
+
#undef TARGET_ENCODE_SECTION_INFO
#define TARGET_ENCODE_SECTION_INFO s390_encode_section_info
#define TARGET_VERSION fprintf (stderr, " (S/390)");
#endif
-/* Hook to override options. */
-#define OPTIMIZATION_OPTIONS(LEVEL, SIZE) optimization_options(LEVEL, SIZE)
-
/* Frame pointer is not used for debugging. */
#define CAN_DEBUG_WITHOUT_FP
extern bool sh_vector_mode_supported_p (enum machine_mode);
#endif /* RTX_CODE */
-extern void sh_optimization_options (int, int);
extern const char *output_jump_label_table (void);
extern int sh_handle_pragma (int (*)(void), void (*)(int), const char *);
extern struct rtx_def *get_fpscr_rtx (void);
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 output_stack_adjust (int, rtx, int, HARD_REG_SET *, bool);
static rtx frame_insn (rtx);
static rtx push (int);
#undef TARGET_OPTION_OVERRIDE
#define TARGET_OPTION_OVERRIDE sh_option_override
+#undef TARGET_OPTION_OPTIMIZATION
+#define TARGET_OPTION_OPTIMIZATION sh_option_optimization
#undef TARGET_PRINT_OPERAND
#define TARGET_PRINT_OPERAND sh_print_operand
}
\f
/* Set default optimization options. */
-void
-sh_optimization_options (int level ATTRIBUTE_UNUSED, int size ATTRIBUTE_UNUSED)
+static void
+sh_option_optimization (int level, int size)
{
if (level)
{
#define DRIVER_SELF_SPECS "%{m2a:%{ml:%eSH2a does not support little-endian}}"
-#define OPTIMIZATION_OPTIONS(LEVEL,SIZE) sh_optimization_options (LEVEL, SIZE)
-
#define ASSEMBLER_DIALECT assembler_dialect
extern int assembler_dialect;
extern void spu_cpu_cpp_builtins (struct cpp_reader * pfile);
extern void builtin_define_std (const char *);
-extern void spu_optimization_options (int level, int size);
extern void spu_c_common_override_options (void);
extern int valid_subreg (rtx op);
extern void spu_expand_extv (rtx * ops, int unsignedp);
/* Prototypes and external defs. */
static void spu_option_override (void);
+static void spu_option_optimization (int, int);
static void spu_init_builtins (void);
static tree spu_builtin_decl (unsigned, bool);
static bool spu_scalar_mode_supported_p (enum machine_mode mode);
#undef TARGET_OPTION_OVERRIDE
#define TARGET_OPTION_OVERRIDE spu_option_override
+#undef TARGET_OPTION_OPTIMIZATION
+#define TARGET_OPTION_OPTIMIZATION spu_option_optimization
+
struct gcc_target targetm = TARGET_INITIALIZER;
-void
-spu_optimization_options (int level ATTRIBUTE_UNUSED, int size ATTRIBUTE_UNUSED)
+static void
+spu_option_optimization (int level ATTRIBUTE_UNUSED, int size ATTRIBUTE_UNUSED)
{
/* Override some of the default param values. With so many registers
larger values are better for these params. */
#define C_COMMON_OVERRIDE_OPTIONS spu_c_common_override_options()
-#define OPTIMIZATION_OPTIONS(level,size) \
- spu_optimization_options(level,size)
-
#define INIT_EXPANDERS spu_init_expanders()
extern int target_flags;
/* Subroutines for insn-output.c for NEC V850 series
Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
- 2006, 2007, 2008, 2009 Free Software Foundation, Inc.
+ 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
Contributed by Jeff Law (law@cygnus.com).
This file is part of GCC.
/* Function prototypes for stupid compilers: */
static bool v850_handle_option (size_t, const char *, int);
+static void v850_option_optimization (int, int);
static void const_double_split (rtx, HOST_WIDE_INT *, HOST_WIDE_INT *);
static int const_costs_int (HOST_WIDE_INT, int);
static int const_costs (rtx, enum rtx_code);
#undef TARGET_STRICT_ARGUMENT_NAMING
#define TARGET_STRICT_ARGUMENT_NAMING v850_strict_argument_naming
+#undef TARGET_OPTION_OPTIMIZATION
+#define TARGET_OPTION_OPTIMIZATION v850_option_optimization
+
struct gcc_target targetm = TARGET_INITIALIZER;
\f
/* Set the maximum size of small memory area TYPE to the value given
}
}
+/* Implement TARGET_OPTION_OPTIMIZATION. */
+
+static void
+v850_option_optimization (int level, int size ATTRIBUTE_UNUSED)
+{
+ if (level)
+ /* Note - we no longer enable MASK_EP when optimizing. This is
+ because of a hardware bug which stops the SLD and SST instructions
+ from correctly detecting some hazards. If the user is sure that
+ their hardware is fixed or that their program will not encounter
+ the conditions that trigger the bug then they can enable -mep by
+ hand. */
+ target_flags |= MASK_PROLOG_FUNCTION;
+}
+
/* Handle the TARGET_PASS_BY_REFERENCE target hook.
Specify whether to pass the argument by reference. */
/* Definitions of target machine for GNU compiler. NEC V850 series
Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
- 2007, 2008, 2009 Free Software Foundation, Inc.
+ 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
Contributed by Jeff Law (law@cygnus.com).
This file is part of GCC.
/* Show we can debug even without a frame pointer. */
#define CAN_DEBUG_WITHOUT_FP
-
-/* Some machines may desire to change what optimizations are
- performed for various optimization levels. This macro, if
- defined, is executed once just after the optimization level is
- determined and before the remainder of the command options have
- been parsed. Values set in this macro are used as the default
- values for the other command line options.
-
- LEVEL is the optimization level specified; 2 if `-O2' is
- specified, 1 if `-O' is specified, and 0 if neither is specified.
-
- SIZE is nonzero if `-Os' is specified, 0 otherwise.
-
- You should not use this macro to change options that are not
- machine-specific. These should uniformly selected by the same
- optimization level on all supported machines. Use this macro to
- enable machine-specific optimizations.
-
- *Do not examine `write_symbols' in this macro!* The debugging
- options are not supposed to alter the generated code. */
-
-#define OPTIMIZATION_OPTIONS(LEVEL,SIZE) \
-{ \
- if (LEVEL) \
- /* Note - we no longer enable MASK_EP when optimizing. This is \
- because of a hardware bug which stops the SLD and SST instructions\
- from correctly detecting some hazards. If the user is sure that \
- their hardware is fixed or that their program will not encounter \
- the conditions that trigger the bug then they can enable -mep by \
- hand. */ \
- target_flags |= MASK_PROLOG_FUNCTION; \
-}
-
\f
/* Target machine storage layout */
};
static void xtensa_option_override (void);
+static void xtensa_option_optimization (int, int);
static enum internal_test map_test_to_internal_test (enum rtx_code);
static rtx gen_int_relational (enum rtx_code, rtx, rtx, int *);
static rtx gen_float_relational (enum rtx_code, rtx, rtx);
#undef TARGET_OPTION_OVERRIDE
#define TARGET_OPTION_OVERRIDE xtensa_option_override
+#undef TARGET_OPTION_OPTIMIZATION
+#define TARGET_OPTION_OPTIMIZATION xtensa_option_optimization
struct gcc_target targetm = TARGET_INITIALIZER;
}
}
+/* Implement TARGET_OPTION_OPTIMIZATION. */
+
+static void
+xtensa_option_optimization (int level ATTRIBUTE_UNUSED,
+ int size ATTRIBUTE_UNUSED)
+{
+ /* Reordering blocks for Xtensa is not a good idea unless the
+ compiler understands the range of conditional branches.
+ Currently all branch relaxation for Xtensa is handled in the
+ assembler, so GCC cannot do a good job of reordering blocks. Do
+ not enable reordering unless it is explicitly requested. */
+ flag_reorder_blocks = 0;
+}
/* A C compound statement to output to stdio stream STREAM the
assembler syntax for an instruction operand X. X is an RTL
#define HAVE_AS_TLS 0
#endif
-/* Reordering blocks for Xtensa is not a good idea unless the compiler
- understands the range of conditional branches. Currently all branch
- relaxation for Xtensa is handled in the assembler, so GCC cannot do a
- good job of reordering blocks. Do not enable reordering unless it is
- explicitly requested. */
-#define OPTIMIZATION_OPTIONS(LEVEL, SIZE) \
- do \
- { \
- flag_reorder_blocks = 0; \
- } \
- while (0)
-
\f
/* Target CPU builtins. */
#define TARGET_CPU_CPP_BUILTINS() \
frontends.
@end defmac
-@defmac OPTIMIZATION_OPTIONS (@var{level}, @var{size})
+@deftypefn {Target Hook} void TARGET_OPTION_OPTIMIZATION (int @var{level}, int @var{size})
Some machines may desire to change what optimizations are performed for
-various optimization levels. This macro, if defined, is executed once
+various optimization levels. This hook, if defined, is executed once
just after the optimization level is determined and before the remainder
of the command options have been parsed. Values set in this macro are
used as the default values for the other command line options.
@code{optimize} attribute.
@strong{Do not examine @code{write_symbols} in
-this macro!} The debugging options are not supposed to alter the
+this hook!} The debugging options are not supposed to alter the
generated code.
-@end defmac
+@end deftypefn
@deftypefn {Target Hook} void TARGET_HELP (void)
This hook is called in response to the user invoking
in response to the @option{-g} option. The default behavior for VMS
is to generate minimal debug info for a traceback in the absence of
@option{-g} unless explicitly overridden with @option{-g0}. This
-behavior is controlled by @code{OPTIMIZATION_OPTIONS} and
+behavior is controlled by @code{TARGET_OPTION_OPTIMIZATION} and
@code{TARGET_OPTION_OVERRIDE}.
@end defmac
once just after all the command options have been parsed.
Don't use this hook to turn on various extra optimizations for
-@option{-O}. That is what @code{OPTIMIZATION_OPTIONS} is for.
+@option{-O}. That is what @code{TARGET_OPTION_OPTIMIZATION} is for.
If you need to do something whenever the optimization level is
changed via the optimize attribute or pragma, see
frontends.
@end defmac
-@defmac OPTIMIZATION_OPTIONS (@var{level}, @var{size})
+@hook TARGET_OPTION_OPTIMIZATION
Some machines may desire to change what optimizations are performed for
-various optimization levels. This macro, if defined, is executed once
+various optimization levels. This hook, if defined, is executed once
just after the optimization level is determined and before the remainder
of the command options have been parsed. Values set in this macro are
used as the default values for the other command line options.
@code{optimize} attribute.
@strong{Do not examine @code{write_symbols} in
-this macro!} The debugging options are not supposed to alter the
+this hook!} The debugging options are not supposed to alter the
generated code.
-@end defmac
+@end deftypefn
@hook TARGET_HELP
This hook is called in response to the user invoking
in response to the @option{-g} option. The default behavior for VMS
is to generate minimal debug info for a traceback in the absence of
@option{-g} unless explicitly overridden with @option{-g0}. This
-behavior is controlled by @code{OPTIMIZATION_OPTIONS} and
+behavior is controlled by @code{TARGET_OPTION_OPTIMIZATION} and
@code{TARGET_OPTION_OVERRIDE}.
@end defmac
once just after all the command options have been parsed.
Don't use this hook to turn on various extra optimizations for
-@option{-O}. That is what @code{OPTIMIZATION_OPTIONS} is for.
+@option{-O}. That is what @code{TARGET_OPTION_OPTIMIZATION} is for.
If you need to do something whenever the optimization level is
changed via the optimize attribute or pragma, see
{
}
+void
+hook_void_int_int (int a ATTRIBUTE_UNUSED, int b ATTRIBUTE_UNUSED)
+{
+}
+
bool
hook_bool_tree_false (tree a ATTRIBUTE_UNUSED)
{
extern void hook_void_FILEptr_constcharptr (FILE *, const char *);
extern void hook_void_tree (tree);
extern void hook_void_tree_treeptr (tree, tree *);
+extern void hook_void_int_int (int, int);
extern int hook_int_const_tree_0 (const_tree);
extern int hook_int_const_tree_const_tree_1 (const_tree, const_tree);
#include "params.h"
#include "diagnostic.h"
#include "opts-diagnostic.h"
-#include "tm_p.h" /* For OPTIMIZATION_OPTIONS. */
#include "insn-attr.h" /* For INSN_SCHEDULING. */
#include "target.h"
#include "tree-pass.h"
set after target options have been processed. */
flag_short_enums = 2;
- /* Initialize target_flags before OPTIMIZATION_OPTIONS so the latter can
- modify it. */
+ /* Initialize target_flags before
+ targetm.target_option.optimization so the latter can modify
+ it. */
target_flags = targetm.default_target_flags;
/* Some targets have ABI-specified unwind tables. */
lto_clear_user_options ();
#endif
-#ifdef OPTIMIZATION_OPTIONS
/* Allow default optimizations to be specified on a per-machine basis. */
- OPTIMIZATION_OPTIONS (optimize, optimize_size);
-#endif
+ targetm.target_option.optimization (optimize, optimize_size);
read_cmdline_options (*decoded_options, *decoded_options_count, lang_mask,
&handlers);
ALLOCATE_INITIAL_VALUE LEGITIMIZE_ADDRESS FRAME_POINTER_REQUIRED \
CAN_ELIMINATE TRAMPOLINE_TEMPLATE INITIALIZE_TRAMPOLINE \
TRAMPOLINE_ADJUST_ADDRESS STATIC_CHAIN STATIC_CHAIN_INCOMING \
- RETURN_POPS_ARGS UNITS_PER_SIMD_WORD OVERRIDE_OPTIONS
+ RETURN_POPS_ARGS UNITS_PER_SIMD_WORD OVERRIDE_OPTIONS \
+ OPTIMIZATION_OPTIONS
/* Other obsolete target macros, or macros that used to be in target
headers and were not used, and may be obsolete or may never have
void, (void),
hook_void_void)
+/* Set default optimizations for the target. */
+DEFHOOK
+(optimization,
+ "",
+ void, (int level, int size),
+ hook_void_int_int)
+
/* Function to determine if one function can inline another function. */
#undef HOOK_PREFIX
#define HOOK_PREFIX "TARGET_"