]> gcc.gnu.org Git - gcc.git/commitdiff
target.def (target_option.optimization): New hook.
authorJoseph Myers <joseph@codesourcery.com>
Thu, 16 Sep 2010 12:04:29 +0000 (13:04 +0100)
committerJoseph Myers <jsm28@gcc.gnu.org>
Thu, 16 Sep 2010 12:04:29 +0000 (13:04 +0100)
* 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

58 files changed:
gcc/ChangeLog
gcc/config/arm/arm-protos.h
gcc/config/arm/arm.c
gcc/config/arm/arm.h
gcc/config/cris/cris.c
gcc/config/cris/cris.h
gcc/config/crx/crx.c
gcc/config/crx/crx.h
gcc/config/frv/frv-protos.h
gcc/config/frv/frv.c
gcc/config/frv/frv.h
gcc/config/h8300/h8300.c
gcc/config/h8300/h8300.h
gcc/config/i386/i386-protos.h
gcc/config/i386/i386.c
gcc/config/i386/i386.h
gcc/config/ia64/ia64-protos.h
gcc/config/ia64/ia64.c
gcc/config/ia64/ia64.h
gcc/config/ia64/vms.h
gcc/config/m32r/m32r.c
gcc/config/m32r/m32r.h
gcc/config/m68hc11/m68hc11-protos.h
gcc/config/mcore/mcore.c
gcc/config/mcore/mcore.h
gcc/config/mep/mep-protos.h
gcc/config/mep/mep.c
gcc/config/mep/mep.h
gcc/config/mmix/mmix.c
gcc/config/mmix/mmix.h
gcc/config/pdp11/pdp11.c
gcc/config/pdp11/pdp11.h
gcc/config/rs6000/rs6000-protos.h
gcc/config/rs6000/rs6000.c
gcc/config/rs6000/rs6000.h
gcc/config/rx/rx-protos.h
gcc/config/rx/rx.c
gcc/config/rx/rx.h
gcc/config/s390/s390-protos.h
gcc/config/s390/s390.c
gcc/config/s390/s390.h
gcc/config/sh/sh-protos.h
gcc/config/sh/sh.c
gcc/config/sh/sh.h
gcc/config/spu/spu-protos.h
gcc/config/spu/spu.c
gcc/config/spu/spu.h
gcc/config/v850/v850.c
gcc/config/v850/v850.h
gcc/config/xtensa/xtensa.c
gcc/config/xtensa/xtensa.h
gcc/doc/tm.texi
gcc/doc/tm.texi.in
gcc/hooks.c
gcc/hooks.h
gcc/opts.c
gcc/system.h
gcc/target.def

index 21941826201422a70a3850dca288ae6930beec9d..1f4770cf555261c4527c88dd39a7298e88832631 100644 (file)
@@ -1,3 +1,100 @@
+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.
index 1f9548524b406d483652b01f9f2ed5fe6594dafd..59e1c5024ec10ef861715a45f1ebfe29c26b8dc7 100644 (file)
@@ -23,7 +23,6 @@
 #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);
index acbaee6ef97c584eca57de5b53945ba49d2389de..206e06cac5205c88abfb7ec0780db31d1ff2a510 100644 (file)
@@ -216,6 +216,7 @@ static tree arm_build_builtin_va_list (void);
 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);
@@ -321,6 +322,8 @@ static const struct attribute_spec arm_attribute_table[] =
 #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
@@ -22627,8 +22630,8 @@ arm_order_regs_for_local_alloc (void)
 }
 
 /* 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
index 9e7e5040c31f7b4167a4bcdd28f8bf4a1e0ce070..8727305a6e21ff6c511df612918efb711a4c67fb 100644 (file)
@@ -498,9 +498,6 @@ extern int arm_arch_hwdiv;
    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.  */
index 6e0421241cbb15ddba7eaf5c77f19201476f3668..52367c2c71d0aee1177623f1047bc77ad955f9af 100644 (file)
@@ -130,6 +130,7 @@ static int cris_arg_partial_bytes (CUMULATIVE_ARGS *, enum machine_mode,
 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);
@@ -211,6 +212,8 @@ int cris_cpu_version = CRIS_DEFAULT_CPU_VERSION;
 
 #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
@@ -2396,6 +2399,15 @@ cris_handle_option (size_t code, const char *arg ATTRIBUTE_UNUSED,
   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.  */
 
index b767b23518da19c72d8e5419984d066500305307..d302c9f55406e87d3a105862f7d59e00acea0847 100644 (file)
@@ -328,15 +328,6 @@ extern int target_flags;
 
 #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
index e8b750c95a3a910d18e222b1279e6d214edbd452..8ae552fe5db8259869d33eb6f6ceced231776aaf 100644 (file)
@@ -1,6 +1,6 @@
 /* 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.
@@ -130,6 +130,7 @@ static bool crx_return_in_memory (const_tree type, const_tree fntype ATTRIBUTE_U
 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                                                                     */
@@ -174,6 +175,10 @@ static const struct attribute_spec crx_attribute_table[] = {
   {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.  */
@@ -1442,3 +1447,13 @@ crx_expand_epilogue (void)
   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;
+}
index a6260f48aa253efa608c686ea52d5881d65fa303..d4bf2743bf3c458f099725f5e58f0a08d40bb1d6 100644 (file)
@@ -1,6 +1,6 @@
 /* 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.
@@ -54,14 +54,6 @@ do {                                                         \
 
 #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
 
index f2081faa05a8c5b0be673f3d027578e89a76412a..68c2a576a63b3b612ec740f20cbc4b922ea16162 100644 (file)
@@ -38,7 +38,6 @@ extern frv_cpu_t frv_cpu_type;                        /* value of -mcpu= */
 /* 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 *);
index 295610d33223026fedca9864a298377efc181796..0730e32d9a4686fa557f45f21f109f813449ac70 100644 (file)
@@ -265,6 +265,7 @@ frv_cpu_t frv_cpu_type = CPU_TYPE;  /* value of -mcpu= */
 
 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 *);
@@ -431,6 +432,8 @@ static bool frv_class_likely_spilled_p              (reg_class_t);
 #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
@@ -850,29 +853,12 @@ frv_option_override (void)
 }
 
 \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)
     {
index 22200dca83c0feb431008fb806ed3949b8ebbaba..463f6ad1ecc75be418754d48c95b7a30d770b82c 100644 (file)
         #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.  */
index 14007821d17260a7c4cf8f7611e1108efcacdce3..551e354b849d1738fa34551c4f87881bcd75e21c 100644 (file)
@@ -303,6 +303,18 @@ enum h8_cpu
   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
@@ -5925,4 +5937,7 @@ h8300_trampoline_init (rtx m_tramp, tree fndecl, rtx cxt)
 #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;
index 79469a0e81b7139487c4dca2c368c651803226cb..7d7437f0f2db2bc52ec91d986d4d1ace1e6c739d 100644 (file)
@@ -82,16 +82,6 @@ extern const char * const *h8_reg_names;
 
 #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)");
index e35a15eb85ca32b5ba3d5591462bfb790f08df41..6f1d6f272cd9594bfd4350b8fe3f03b509ee10e4 100644 (file)
@@ -20,7 +20,6 @@ along with GCC; see the file COPYING3.  If not see
 <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);
index fd731c001207935437f102bdff8bfeb061e47746..61c73c0de7bd5ab2b4cf1b968ae3970f00076285 100644 (file)
@@ -4516,8 +4516,8 @@ x86_output_aligned_bss (FILE *file, tree decl ATTRIBUTE_UNUSED,
   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.  */
@@ -32504,6 +32504,8 @@ ix86_units_per_simd_word (enum machine_mode mode)
 
 #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
index 8a9600c27d4f948a24cacd32dc28b5decbea12ae..22dd02b0bb86219d74d4164f582422f4452046cd 100644 (file)
@@ -506,10 +506,6 @@ extern enum calling_abi ix86_abi;
    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.  */
index 4fc6a425691d49e5c67aef0aa4ac026353ab4481..8a3ff4b8b08c9183836c60d4397a09350346f883 100644 (file)
@@ -99,7 +99,6 @@ extern void ia64_hpux_handle_builtin_pragma (struct cpp_reader *);
 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);
index ab01a5588d3881e35e48731f08003b9258128c28..d02d2b8fc3f41033f861ca96554bc1a7f33878c1 100644 (file)
@@ -202,6 +202,7 @@ static rtx gen_fr_spill_x (rtx, rtx, rtx);
 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,
@@ -361,6 +362,8 @@ static const struct attribute_spec ia64_attribute_table[] =
 
 #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
@@ -10719,10 +10722,14 @@ ia64_invalid_binary_op (int op ATTRIBUTE_UNUSED, const_tree type1, const_tree ty
 }
 
 /* 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);
 
index 13aa2cd0e18a57fc5b1a32b71df3234e21dc5c32..dbb5ebd434b157a86c40e6b3e8a78b828ed102b3 100644 (file)
@@ -118,14 +118,6 @@ enum processor_type
 };
 
 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 */
 
@@ -1897,8 +1889,4 @@ struct GTY(()) machine_function
 /* 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 */
index 3d678ce5f85aa19c7ea2ad12449633f0ba3e1791..e077e7d14f1c6060b3b25ec1a8e1fb78d7994648 100644 (file)
@@ -183,11 +183,10 @@ typedef struct crtl_name_spec
          }                                                                \
     } 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.  */
index 93030add6cbc14eb5359c6af84b5042205f228e1..7b8b8fc3d1339bda76654197cf3c1c2ab6cfd430 100644 (file)
@@ -64,6 +64,7 @@ enum m32r_sdata m32r_sdata = M32R_SDATA_DEFAULT;
 /* 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);
@@ -153,6 +154,8 @@ static const struct attribute_spec m32r_attribute_table[] =
 #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
@@ -280,6 +283,18 @@ m32r_option_override (void)
   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
index ee867bf8fe22f1e7417f4f49b22a741ffc61a935..c232a74258caed99534458515e95f096b2dbd2fe 100644 (file)
@@ -310,21 +310,6 @@ extern enum m32r_sdata m32r_sdata;
 #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.  */
index a0c4941c85b20695f9bc37d5aa0a4e08bdbefdbc..e98c1909baf3f66ed7317f709fa5a1268663f4d0 100644 (file)
@@ -20,7 +20,6 @@ along with GCC; see the file COPYING3.  If not see
 <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);
index 5556d7d1ed439d31fa6f7c708cadb7c69ecea49a..b81a8b939e58f0f23a7a872440751ab60d5fd6cb 100644 (file)
@@ -150,6 +150,7 @@ static int        mcore_arg_partial_bytes       (CUMULATIVE_ARGS *,
 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.  */
 
@@ -228,6 +229,8 @@ static const struct attribute_spec mcore_attribute_table[] =
 
 #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
@@ -2690,6 +2693,34 @@ mcore_option_override (void)
   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.  */
index d703baf2e312ebb22d2b4d1edf7b461e9dea5add..5044811761bf0fd686ffbeacfbe789baafeb5263 100644 (file)
@@ -85,31 +85,6 @@ extern char * mcore_current_function_name;
 /* 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)      \
index d3e21bd70f3c1e46a41d7ca198e38d62db3b4950..4ab86b5faab6761a349e5eea4b14ce438f889b20 100644 (file)
@@ -20,7 +20,6 @@ along with GCC; see the file COPYING3.  If not see
 <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);
index 0e6ce08176fe4e6c6e304bc78482b97ee9ce7c68..712abbe5f2aa0bd4a0a6b82e67631c658c4ea1d5 100644 (file)
@@ -291,8 +291,8 @@ mep_conditional_register_usage (void)
     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.  */
@@ -7411,6 +7411,8 @@ mep_asm_init_sections (void)
 #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
index 83a5582c15876e6b2343348523580e53b6fb1128..1bebf3badb7676fc44c9e73f1da52356e5f7a869 100644 (file)
@@ -163,8 +163,6 @@ extern int target_flags;
 /* end-coproc-selection-table */
 
 #define CAN_DEBUG_WITHOUT_FP
-
-#define OPTIMIZATION_OPTIONS(LEVEL, FOR_SIZE) mep_optimization_options ()
 \f
 
 #define BITS_BIG_ENDIAN 0
index ce10a1b9bd0e66c7b5f72e28169c2dad0867605b..293a2f5bde6ce5b7c6af6d4d997d64c4f489f5dc 100644 (file)
@@ -114,6 +114,7 @@ rtx mmix_compare_op1;
 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);
@@ -236,6 +237,8 @@ static void mmix_trampoline_init (rtx, tree, rtx);
 
 #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;
 
@@ -259,6 +262,18 @@ mmix_option_override (void)
     }
 }
 
+/* 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
index 5672827f7c118ed50b28c5c458a6480c85ac6cce..5908a7542843c8521871e46d77ed642bdbdf90a7 100644 (file)
@@ -149,19 +149,6 @@ extern int target_flags;
 #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 */
index 5629718d948211bfc83c5e543e8d7f08623c7e75..2812e9509b1fbeb6e21983985bc5d1a333c57bca 100644 (file)
@@ -145,6 +145,7 @@ decode_pdp11_d (const struct real_format *fmt ATTRIBUTE_UNUSED,
 /* 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);
@@ -182,6 +183,8 @@ static void pdp11_trampoline_init (rtx, tree, rtx);
   (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
@@ -218,6 +221,21 @@ pdp11_handle_option (size_t code, const char *arg ATTRIBUTE_UNUSED,
     }
 }
 
+/* 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
index 4ebd8877c0d94e08e6f9485e696a2233a346495e..332e99db245a4ce5aff47f520b3458293fd9808d 100644 (file)
@@ -949,28 +949,6 @@ extern struct rtx_def *cc0_reg_rtx;
 #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 */
index 38dc6937ee498630fd23538dbbfe4a5c78885cd1..c18899448ee45e55cb762b96f795fd938c227a0a 100644 (file)
@@ -153,7 +153,6 @@ extern enum direction function_arg_padding (enum machine_mode, const_tree);
 
 #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);
index 0d95b39f37377718e7f3bee89df9d5000157e299..4b874399ac7624b3a9deac30527f1f4db9d19cd8 100644 (file)
@@ -1135,6 +1135,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 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 *);
@@ -1596,6 +1597,9 @@ 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_VECTORIZE_BUILTIN_VECTORIZED_FUNCTION
 #define TARGET_VECTORIZE_BUILTIN_VECTORIZED_FUNCTION \
   rs6000_builtin_vectorized_function
@@ -3634,8 +3638,9 @@ rs6000_parse_tls_size_option (void)
     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
index 1c2c391cc5e4d79d792dda8ef3f7d3232d5d5e66..b12ed819ab8ba70e67e2a875fe71921f8c0cd93c 100644 (file)
@@ -622,9 +622,6 @@ extern unsigned char rs6000_recip_bits[];
 /* 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
 
index 3adce24fc0046dec39c0c5be08e6789fc96b9b3e..18bc64bb96ede577e579fbd3ff90956469c310f7 100644 (file)
@@ -28,7 +28,6 @@
 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);
index a5be690340d8eacfe352c78748a69b59d90a55ed..22992732c9ae1f0edb938ea3477d599add160796 100644 (file)
@@ -2162,8 +2162,10 @@ rx_handle_option (size_t code, const char *  arg ATTRIBUTE_UNUSED, int value)
   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;
@@ -2803,6 +2805,9 @@ rx_memory_move_cost (enum machine_mode mode, enum reg_class regclass, bool in)
 #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" */
index 5e5167edf747c8c383559d985a63408f5ffc8c2f..140d6d41fe2d7ed6bcd4d2141bdb076a837f38ce 100644 (file)
@@ -632,9 +632,6 @@ extern int rx_float_compare_mode;
 #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.  */
index d3e5ec7718e4d861f91872b06aad8c8b059ce65d..e3cc59c64538a11fa371deedecf9095a1fd9ee9d 100644 (file)
@@ -34,7 +34,6 @@ extern bool s390_check_symref_alignment (rtx addr, HOST_WIDE_INT alignment);
 
 /* 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);
index e07b1d6e6ea2a10e95b03950b404a738796154a0..11e9fe2e724ca5b75b759fdfbac8ef6100b9a13c 100644 (file)
@@ -1465,8 +1465,8 @@ s390_init_machine_status (void)
 
    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;
@@ -1675,7 +1675,7 @@ s390_option_override (void)
   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)
@@ -10426,6 +10426,9 @@ s390_loop_unroll_adjust (unsigned nunroll, struct loop *loop)
 #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
 
index 8f5a3a09dcf50d1bc3979290ae52fda6103124e2..fcc63b0d3321ad71d0ccce35ab2727e3e99ca123 100644 (file)
@@ -149,9 +149,6 @@ extern int s390_arch_flags;
 #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
 
index f6741eedf570604db65cdfe4424f563647f11dd5..5a2fd2e711e1896e25c7bfa910ca4d1ab346614e 100644 (file)
@@ -124,7 +124,6 @@ extern rtx sh_gen_truncate (enum machine_mode, rtx, int);
 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);
index d521437c571f5a65da17ee434745aa4ed9b70de9..1e8b141813a3145815be60e85b4e45607509c1c3 100644 (file)
@@ -183,6 +183,7 @@ static int noncall_uses_reg (rtx, rtx, rtx *);
 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);
@@ -339,6 +340,8 @@ static const struct attribute_spec sh_attribute_table[] =
 
 #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
@@ -694,8 +697,8 @@ sh_handle_option (size_t code, const char *arg ATTRIBUTE_UNUSED,
 }
 \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)
     {
index 7bcf9e9c04bc4b6d4d702339a5f80b83da2c43fe..2e9ee76d3ef6e5b03c3a76463de9c8beef903fb5 100644 (file)
@@ -470,8 +470,6 @@ do { \
 
 #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;
index d456979101b31ed9c42e9672b7a35e23f9dda61f..f0ecd93f3f9d31a2b300878087d6334d6a410feb 100644 (file)
@@ -20,7 +20,6 @@
 
 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);
index dd4201f10471fadc940bbb026779190392487a01..8b462ecf5e315bfd4232630b87d078105f36ffb3 100644 (file)
@@ -150,6 +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_init_builtins (void);
 static tree spu_builtin_decl (unsigned, bool);
 static bool spu_scalar_mode_supported_p (enum machine_mode mode);
@@ -468,10 +469,13 @@ 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
+
 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.  */
index 251e2391b689ed3d5443cae795c91ec4398ad77e..878cb6383e545e81c30979606542842fa07d254a 100644 (file)
@@ -22,9 +22,6 @@
 
 #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;
index 8f8cd14cdd143e34198cbbd186c7fedcf3033cd6..49b8e756e92304a62acbb2b25e863b7ef4858cac 100644 (file)
@@ -1,6 +1,6 @@
 /* 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.
@@ -50,6 +50,7 @@
 
 /* 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);
@@ -218,6 +219,9 @@ static const struct attribute_spec v850_attribute_table[] =
 #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
@@ -279,6 +283,21 @@ v850_handle_option (size_t code, const char *arg, int value ATTRIBUTE_UNUSED)
     }
 }
 
+/* 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.  */
 
index 1fb87f3d269c868eb68b610d4ed958ceb6f297a9..9ae0784af564b6a4804c770e44cc13fb1cf56dc1 100644 (file)
@@ -1,6 +1,6 @@
 /* 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.
@@ -140,39 +140,6 @@ extern struct small_memory_info small_memory[(int)SMALL_MEMORY_max];
 
 /* 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 */
 
index 0820ab72a4650068d70870481109d692dfd47e00..7b261e3f3f29ddd01c381116bd4fe62f61b491fa 100644 (file)
@@ -119,6 +119,7 @@ const enum reg_class xtensa_regno_to_class[FIRST_PSEUDO_REGISTER] =
 };
 
 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);
@@ -254,6 +255,8 @@ static const int reg_nonleaf_alloc_order[FIRST_PSEUDO_REGISTER] =
 
 #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;
 
@@ -2168,6 +2171,19 @@ xtensa_option_override (void)
     }
 }
 
+/* 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
index 4a213d0417935ce76f24bd340f339febb4104d52..1bc2fdef0741b0a567123146b0a3dee0909000bf 100644 (file)
@@ -74,18 +74,6 @@ extern unsigned xtensa_current_frame_size;
 #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()                                      \
index 54f2d35224efee222b4bdacb5094150b365e5bed..a5356ebbcbbdd55a541c2421081a0b8c88214ca6 100644 (file)
@@ -791,9 +791,9 @@ used to alter option flag variables which only exist in those
 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.
@@ -808,9 +808,9 @@ options are changed via @code{#pragma GCC optimize} or by using the
 @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
@@ -9414,7 +9414,7 @@ Define this macro if GCC should produce debugging output for VMS
 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
 
@@ -9762,7 +9762,7 @@ a particular target machine.  You can override the hook
 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
index 3f64388d7a39ee0e567c868ee8d6c9b7441ca897..2fcd97956dd02b7846e2a557322bc3f72922b198 100644 (file)
@@ -791,9 +791,9 @@ used to alter option flag variables which only exist in those
 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.
@@ -808,9 +808,9 @@ options are changed via @code{#pragma GCC optimize} or by using the
 @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
@@ -9398,7 +9398,7 @@ Define this macro if GCC should produce debugging output for VMS
 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
 
@@ -9744,7 +9744,7 @@ a particular target machine.  You can override the hook
 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
index 4d5be73c5994fe6e171c1c0c208e890fead93a03..9969bce177be9c3aba4d8cb210ec5dd152b8b5a3 100644 (file)
@@ -181,6 +181,11 @@ hook_void_tree_treeptr (tree a ATTRIBUTE_UNUSED, tree *b ATTRIBUTE_UNUSED)
 {
 }
 
+void
+hook_void_int_int (int a ATTRIBUTE_UNUSED, int b ATTRIBUTE_UNUSED)
+{
+}
+
 bool
 hook_bool_tree_false (tree a ATTRIBUTE_UNUSED)
 {
index 9e4a0aeeb748c255d4a740407e2c0f3ee0a59584..de18b86423f9e1beb75dc3600b743ee43168f638 100644 (file)
@@ -60,6 +60,7 @@ extern void hook_void_rtx_int (rtx, int);
 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);
index e59332f68f8265e68cfb33c3bee36b68131668a3..49c91a4a09486a7256befa62c5a5a9c160faa734 100644 (file)
@@ -37,7 +37,6 @@ along with GCC; see the file COPYING3.  If not see
 #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"
@@ -888,8 +887,9 @@ decode_options (unsigned int argc, const char **argv,
         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.  */
@@ -901,10 +901,8 @@ decode_options (unsigned int argc, const char **argv,
   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);
index 460b8a83b8e851824ccd1f8dacade25192922d6d..8928ce6a316826f130cd521d0fb00ae0cc0b7d05 100644 (file)
@@ -715,7 +715,8 @@ extern void fancy_abort (const char *, int, const char *) ATTRIBUTE_NORETURN;
        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
index 61aae90f9df31293d5b589871e19fd061b48c10a..35c9799062c57a5426ca8d449826729e11fdad68 100644 (file)
@@ -2313,6 +2313,13 @@ DEFHOOK
  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_"
This page took 0.318053 seconds and 5 git commands to generate.