]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
target-def.h (TARGET_HAVE_NAMED_SECTIONS): Move to common/common-target-def.h.
authorJoseph Myers <joseph@codesourcery.com>
Tue, 14 Jun 2011 23:11:35 +0000 (00:11 +0100)
committerJoseph Myers <jsm28@gcc.gnu.org>
Tue, 14 Jun 2011 23:11:35 +0000 (00:11 +0100)
* target-def.h (TARGET_HAVE_NAMED_SECTIONS): Move to
common/common-target-def.h.
* target.def (default_target_flags, handle_option,
supports_split_stack, optimization_table, init_struct,
except_unwind_info, unwind_tables_default, have_named_sections):
Move to common/common-target.def.
* target.h (enum opt_levels, struct default_options): Move to
common/common-target.h.
* targhooks.c (default_except_unwind_info,
dwarf2_except_unwind_info, sjlj_except_unwind_info,
default_target_handle_option, empty_optimization_table): Move to
common/common-targhooks.c.
* targhooks.h (default_except_unwind_info,
dwarf2_except_unwind_info, sjlj_except_unwind_info,
default_target_handle_option, empty_optimization_table): Move to
common/common-targhooks.h.
* common/common-target-def.h: Include common/common-targhooks.h.
(TARGET_HAVE_NAMED_SECTIONS): Define if TARGET_ASM_NAMED_SECTION
defined.
* common/common-target.def (handle_option, option_init_struct,
option_optimization_table, default_target_flags,
except_unwind_info, supports_split_stack, unwind_tables_default,
have_named_sections): Move from target.def.
(HOOK_PREFIX): Undefine at end of file.
* common/common-target.h: Include input.h.
(enum opt_levels, struct default_options): Move from target.h.
* common/common-targhooks.c, common/common-targhooks.h: New.
* config.gcc (target_has_targetm_common): Default to yes.
(moxie*): Set target_has_targetm_common=no.
(hppa*-*-*): Don't set target_has_targetm_common=yes.
* doc/tm.texi: Regenerate.
* Makefile.in (COMMON_TARGET_H): Add $(INPUT_H).
(C_TARGET_DEF_H): Add common/common-targhooks.h.
(GCC_OBJS): Remove vec.o.
(OBJS): Remove hooks.o and vec.o.
(OBJS-libcommon-target): Add vec.o, hooks.o and
common/common-targhooks.o.
(c-family/c-common.o, c-family/c-cppbuiltin.o, lto-opts.o, tree.o,
tree-tailcall.o, opts.o, toplev.o, varasm.o, function.o, except.o,
expr.o, explow.o, dbxout.o, dwarf2out.o, cfgrtl.o, haifa-sched.o,
cfglayout.o, $(out_object_file), $(common_out_object_file)):
Update dependencies.
(common/common-targhooks.o): New.
* common/config/default-common.c: Include tm.h.  Add FIXME
comment.
* common/config/pa/pa-common.c: Include more headers.  Take
copyright dates from pa.c.
(pa_option_optimization_table, pa_handle_option,
TARGET_OPTION_OPTIMIZATION_TABLE, TARGET_DEFAULT_TARGET_FLAGS,
TARGET_HANDLE_OPTION): Move from pa.c.
* common/config/alpha/alpha-common.c,
common/config/arm/arm-common.c, common/config/avr/avr-common.c,
common/config/bfin/bfin-common.c,
common/config/cris/cris-common.c,
common/config/fr30/fr30-common.c, common/config/frv/frv-common.c,
common/config/h8300/h8300-common.c,
common/config/i386/i386-common.c,
common/config/ia64/ia64-common.c,
common/config/iq2000/iq2000-common.c,
common/config/lm32/lm32-common.c,
common/config/m32c/m32c-common.c,
common/config/m32r/m32r-common.c,
common/config/m68k/m68k-common.c,
common/config/mcore/mcore-common.c,
common/config/mep/mep-common.c,
common/config/microblaze/microblaze-common.c,
common/config/mips/mips-common.c,
common/config/mmix/mmix-common.c,
common/config/mn10300/mn10300-common.c,
common/config/pdp11/pdp11-common.c,
common/config/picochip/picochip-common.c,
common/config/rs6000/rs6000-common.c,
common/config/rx/rx-common.c, common/config/s390/s390-common.c,
common/config/score/score-common.c, common/config/sh/sh-common.c,
common/config/sparc/sparc-common.c,
common/config/spu/spu-common.c, common/config/v850/v850-common.c,
common/config/vax/vax-common.c,
common/config/xstormy16/xstormy16-common.c,
common/config/xtensa/xtensa-common.c: New.
* config/alpha/alpha.c: Include common/common-target.h.
(alpha_option_optimization_table, alpha_handle_option,
TARGET_DEFAULT_TARGET_FLAGS, TARGET_HANDLE_OPTION,
TARGET_OPTION_OPTIMIZATION_TABLE): Move to alpha-common.c.
* config/arm/arm-protos.h (arm_except_unwind_info): Declare.
* config/arm/arm.c (arm_option_optimization_table,
TARGET_DEFAULT_TARGET_FLAGS, TARGET_OPTION_OPTIMIZATION_TABLE,
TARGET_EXCEPT_UNWIND_INFO, arm_except_unwind_info): Move to
arm-common.c.
* config/avr/avr.c (avr_option_optimization_table,
TARGET_OPTION_OPTIMIZATION_TABLE, TARGET_EXCEPT_UNWIND_INFO): Move
to avr-common.c.
* config/bfin/bfin.c (struct bfin_cpu): Move to bfin.h.
(bfin_cpus, bfin_handle_option, TARGET_HANDLE_OPTION,
TARGET_DEFAULT_TARGET_FLAGS): Move to bfin-common.c.
* config/bfin/bfin.h struct bfin_cpu): Move from bfin.c.
* config/cris/cris.c (cris_option_optimization_table,
TARGET_DEFAULT_TARGET_FLAGS, TARGET_HANDLE_OPTION,
TARGET_OPTION_OPTIMIZATION_TABLE, cris_handle_option): Move to
cris-common.c.
* config/fr30/fr30.c (fr30_option_optimization_table,
TARGET_EXCEPT_UNWIND_INFO, TARGET_OPTION_OPTIMIZATION_TABLE): Move
to fr30-common.c.
* config/frv/frv.c (frv_option_optimization_table,
MASK_DEFAULT_ALLOC_CC, TARGET_DEFAULT_TARGET_FLAGS,
TARGET_OPTION_OPTIMIZATION_TABLE): Move to frv-common.c.
* config/h8300/h8300.c (h8300_option_optimization_table,
TARGET_DEFAULT_TARGET_FLAGS, TARGET_OPTION_OPTIMIZATION_TABLE,
TARGET_EXCEPT_UNWIND_INFO): Move to h8300-common.c.
* config/i386/i386-protos.h (ix86_handle_option): Declare.
* config/i386/i386.c: Include common/common-target.h.
(OPTION_MASK_ISA_MMX_SET, OPTION_MASK_ISA_3DNOW_SET,
OPTION_MASK_ISA_SSE_SET, OPTION_MASK_ISA_SSE2_SET,
OPTION_MASK_ISA_SSE3_SET, OPTION_MASK_ISA_SSSE3_SET,
OPTION_MASK_ISA_SSE4_1_SET, OPTION_MASK_ISA_SSE4_2_SET,
OPTION_MASK_ISA_AVX_SET, OPTION_MASK_ISA_FMA_SET,
OPTION_MASK_ISA_SSE4_SET, OPTION_MASK_ISA_SSE4A_SET,
OPTION_MASK_ISA_FMA4_SET, OPTION_MASK_ISA_XOP_SET,
OPTION_MASK_ISA_LWP_SET, OPTION_MASK_ISA_AES_SET,
OPTION_MASK_ISA_PCLMUL_SET, OPTION_MASK_ISA_ABM_SET,
OPTION_MASK_ISA_BMI_SET, OPTION_MASK_ISA_TBM_SET,
OPTION_MASK_ISA_POPCNT_SET, OPTION_MASK_ISA_CX16_SET,
OPTION_MASK_ISA_SAHF_SET, OPTION_MASK_ISA_MOVBE_SET,
OPTION_MASK_ISA_CRC32_SET, OPTION_MASK_ISA_FSGSBASE_SET,
OPTION_MASK_ISA_RDRND_SET, OPTION_MASK_ISA_F16C_SET,
OPTION_MASK_ISA_MMX_UNSET, OPTION_MASK_ISA_3DNOW_UNSET,
OPTION_MASK_ISA_3DNOW_A_UNSET, OPTION_MASK_ISA_SSE_UNSET,
OPTION_MASK_ISA_SSE2_UNSET, OPTION_MASK_ISA_SSE3_UNSET,
OPTION_MASK_ISA_SSSE3_UNSET, OPTION_MASK_ISA_SSE4_1_UNSET,
OPTION_MASK_ISA_SSE4_2_UNSET, OPTION_MASK_ISA_AVX_UNSET,
OPTION_MASK_ISA_FMA_UNSET, OPTION_MASK_ISA_SSE4_UNSET,
OPTION_MASK_ISA_SSE4A_UNSET, OPTION_MASK_ISA_FMA4_UNSET,
OPTION_MASK_ISA_XOP_UNSET, OPTION_MASK_ISA_LWP_UNSET,
OPTION_MASK_ISA_AES_UNSET, OPTION_MASK_ISA_PCLMUL_UNSET,
OPTION_MASK_ISA_ABM_UNSET, OPTION_MASK_ISA_BMI_UNSET,
OPTION_MASK_ISA_TBM_UNSET, OPTION_MASK_ISA_POPCNT_UNSET,
OPTION_MASK_ISA_CX16_UNSET, OPTION_MASK_ISA_SAHF_UNSET,
OPTION_MASK_ISA_MOVBE_UNSET, OPTION_MASK_ISA_CRC32_UNSET,
OPTION_MASK_ISA_FSGSBASE_UNSET, OPTION_MASK_ISA_RDRND_UNSET,
OPTION_MASK_ISA_F16C_UNSET, ix86_handle_option,
ix86_option_optimization_table, ix86_option_init_struct,
ix86_supports_split_stack, TARGET_DEFAULT_TARGET_FLAGS,
TARGET_HANDLE_OPTION, TARGET_OPTION_OPTIMIZATION_TABLE,
TARGET_OPTION_INIT_STRUCT, TARGET_SUPPORTS_SPLIT_STACK): Move to
i386-common.c.
* config/i386/t-i386 (i386.o): Update dependencies.
* config/ia64/ia64-protos.h (ia64_except_unwind_info): Declare.
* config/ia64/ia64.c (ia64_option_optimization_table,
TARGET_OPTION_OPTIMIZATION_TABLE, TARGET_EXCEPT_UNWIND_INFO,
TARGET_DEFAULT_TARGET_FLAGS, TARGET_HANDLE_OPTION,
ia64_handle_option): Move to ia64-common.c.
* config/iq2000/iq2000.c (iq2000_option_optimization_table,
TARGET_OPTION_OPTIMIZATION_TABLE): Move to iq2000-common.c.
* config/lm32/lm32.c (lm32_option_optimization_table,
TARGET_OPTION_OPTIMIZATION_TABLE, TARGET_EXCEPT_UNWIND_INFO): Move
to lm32-common.c.
* config/m32c/m32c.c (TARGET_HAVE_NAMED_SECTIONS): Move to
m32c-common.c.
* config/m32r/m32r.c (m32r_option_optimization_table,
TARGET_DEFAULT_TARGET_FLAGS, TARGET_HANDLE_OPTION,
TARGET_OPTION_OPTIMIZATION_TABLE, TARGET_EXCEPT_UNWIND_INFO,
m32r_handle_option): Move to m32r-common.c.
(m32r_memory_move_cost): Remove comment referring to
TARGET_HANDLE_OPTION.
* config/m68k/m68k.c (TARGET_HANDLE_OPTION, m68k_handle_option):
Move to m68k-common.c.
* config/mcore/mcore.c (mcore_option_optimization_table,
TARGET_DEFAULT_TARGET_FLAGS, TARGET_OPTION_OPTIMIZATION_TABLE,
TARGET_EXCEPT_UNWIND_INFO): Move to mcore-common.c.
* config/mep/mep.c (mep_option_optimization_table,
mep_handle_option, TARGET_HANDLE_OPTION,
TARGET_OPTION_OPTIMIZATION_TABLE, TARGET_DEFAULT_TARGET_FLAGS):
Move to mep-common.c.
* config/microblaze/microblaze.c
(microblaze_option_optimization_table,
TARGET_DEFAULT_TARGET_FLAGS, TARGET_OPTION_OPTIMIZATION_TABLE,
TARGET_EXCEPT_UNWIND_INFO): Move to microblaze-common.c.
* config/mips/mips.c (mips_handle_option,
mips_option_optimization_table, TARGET_OPTION_OPTIMIZATION_TABLE,
TARGET_DEFAULT_TARGET_FLAGS, TARGET_HANDLE_OPTION): Move to
mips-common.c.
* config/mmix/mmix.c (mmix_option_optimization_table,
TARGET_DEFAULT_TARGET_FLAGS, TARGET_OPTION_OPTIMIZATION_TABLE):
Move to mmix-common.c.
* config/mn10300/mn10300.c (mn10300_option_optimization_table,
mn10300_handle_option, TARGET_EXCEPT_UNWIND_INFO,
TARGET_DEFAULT_TARGET_FLAGS, TARGET_HANDLE_OPTION,
TARGET_OPTION_OPTIMIZATION_TABLE): Move to mn10300-common.c.
* config/pa/pa.c: Include common/common-target.h.
(pa_option_optimization_table, TARGET_OPTION_OPTIMIZATION_TABLE,
TARGET_DEFAULT_TARGET_FLAGS, TARGET_HANDLE_OPTION,
pa_handle_option): Move to pa-common.c.
(pa_option_override): Use targetm_common.except_unwind_info.
(pa_asm_output_mi_thunk, pa_function_section): Use
targetm_common.have_named_sections.
* config/pdp11/pdp11.c (pdp11_option_optimization_table,
TARGET_DEFAULT_TARGET_FLAGS, TARGET_HANDLE_OPTION,
TARGET_OPTION_OPTIMIZATION_TABLE, TARGET_OPTION_INIT_STRUCT,
pdp11_handle_option, pdp11_option_init_struct): Move to
pdp11-common.c.
* config/picochip/picochip.c (picochip_option_optimization_table,
TARGET_HAVE_NAMED_SECTIONS, TARGET_OPTION_OPTIMIZATION_TABLE,
TARGET_EXCEPT_UNWIND_INFO): Move to picochip-common.c.
* config/rs6000/rs6000.c: Include common/common-target.h.
(rs6000_option_optimization_table, TARGET_HANDLE_OPTION,
TARGET_OPTION_INIT_STRUCT, TARGET_OPTION_OPTIMIZATION_TABLE,
TARGET_DEFAULT_TARGET_FLAGS, rs6000_option_init_struct,
rs6000_handle_option): Move to rs6000-common.c.
* config/rs6000/t-rs6000 (rs6000.o): Update dependencies.
* config/rx/rx.c (rx_handle_option, rx_option_optimization_table,
TARGET_HANDLE_OPTION, TARGET_OPTION_OPTIMIZATION_TABLE,
TARGET_EXCEPT_UNWIND_INFO): Move to rx-common.c.
* config/s390/s390.c (processor_flags_table,
s390_option_optimization_table, s390_option_init_struct,
s390_handle_option, TARGET_DEFAULT_TARGET_FLAGS,
TARGET_HANDLE_OPTION, TARGET_OPTION_OPTIMIZATION_TABLE,
TARGET_OPTION_INIT_STRUCT): Move to s390-common.c.
* config/s390/s390.h (processor_flags_table): Declare.
* config/score/score.c (score_option_optimization_table,
TARGET_DEFAULT_TARGET_FLAGS, TARGET_HANDLE_OPTION,
TARGET_OPTION_OPTIMIZATION_TABLE, MASK_ALL_CPU_BITS,
score_handle_option): Move to score-common.c.
* config/sh/sh.c (sh_option_optimization_table,
TARGET_OPTION_OPTIMIZATION_TABLE, TARGET_OPTION_INIT_STRUCT,
TARGET_DEFAULT_TARGET_FLAGS, TARGET_HANDLE_OPTION,
sh_handle_option, sh_option_init_struct): Move to sh-common.c.
* config/sparc/sparc.c: Include common/common-target.h.
(sparc_option_optimization_table, TARGET_DEFAULT_TARGET_FLAGS,
TARGET_OPTION_OPTIMIZATION_TABLE): Move to sparc-common.c.
* config/spu/spu.c (TARGET_DEFAULT_TARGET_FLAGS,
TARGET_OPTION_INIT_STRUCT, TARGET_EXCEPT_UNWIND_INFO,
spu_option_init_struct): Move to spu-common.c.
* config/stormy16/stormy16.c (xstorym16_option_optimization_table,
TARGET_OPTION_OPTIMIZATION_TABLE): Move to xstormy16-common.c.
* config/v850/v850.c (small_memory_physical_max,
v850_handle_memory_optionn v850_handle_option,
v850_option_optimization_table, TARGET_DEFAULT_TARGET_FLAGS,
TARGET_HANDLE_OPTION, TARGET_OPTION_OPTIMIZATION_TABLE): Move to
v850-common.c.
* config/vax/vax.c (TARGET_DEFAULT_TARGET_FLAGS): Move to
vax-common.c.
* config/xtensa/xtensa.c (xtensa_option_optimization_table,
TARGET_DEFAULT_TARGET_FLAGS, TARGET_OPTION_OPTIMIZATION_TABLE):
Move to xtensa-common.c.
* cfglayout.c: Include common/common-target.h.
(fixup_reorder_chain): Use targetm_common.have_named_sections.
* cfgrtl.c: Include common/common-target.h.
(force_nonfallthru_and_redirect, commit_one_edge_insertion): Use
targetm_common.have_named_sections.
* dbxout.c: Include common/common-target.h.
(dbxout_function_end): Use targetm_common.have_named_sections.
* defaults.h (STACK_OLD_CHECK_PROTECT, STACK_CHECK_PROTECT): Use
targetm_common.except_unwind_info.
* dwarf2out.c: Include common/common-target.h.
(dwarf2out_do_frame, dwarf2out_do_cfi_asm,
dwarf2out_begin_prologue, dwarf2out_frame_init,
dwarf2out_frame_finish, dwarf2out_assembly_start): Use
targetm_common.except_unwind_info.
* except.c: Include common/common-target.h.
(init_eh, finish_eh_generation,
output_one_function_exception_table): Use
targetm_common.except_unwind_info.
(switch_to_exception_section): Use
targetm_common.have_named_sections.
* explow.c: Include common/common-target.h.
* expr.c: Include common/common-target.h.
(build_personality_function): Use
targetm_common.except_unwind_info.
* function.c: Include common/common-target.h.
(expand_function_end): Use targetm_common.except_unwind_info.
* haifa-sched.c: Include common/common-target.h.
(sched_create_recovery_edges): Use
targetm_common.have_named_sections.
* lto-opts.c: Include common/common-target.h instead of target.h.
(lto_reissue_options): Use targetm_common.handle_option.
* opts.c: Include common/common-target.h.
(target_handle_option): Use targetm_common.handle_option.
(init_options_struct): Update comment referring to
targetm.target_option.optimization.  Use
targetm_common.default_target_flags,
targetm_common.unwind_tables_default and
targetm_common.option_init_struct.
(default_options_optimization): Use
targetm_common.option_optimization_table.
(finish_options): Use targetm_common.except_unwind_info,
targetm_common.unwind_tables_default,
targetm_common.have_named_sections and
targetm_common.supports_split_stack.
* toplev.c: Include common/common-target.h.
(process_options): Use targetm_common.have_named_sections.
* tree-tailcall.c: Include common/common-target.h.
(suitable_for_tail_call_opt_p): Use
targetm_common.except_unwind_info.
* tree.c: Include common/common-target.h.
(build_common_builtin_nodes): Use
targetm_common.except_unwind_info.
* varasm.c: Include common/common-target.h.
(resolve_unique_section, hot_function_section,
default_function_section): Use targetm_common.have_named_sections.

ada:
* gcc-interface/Make-lang.in (gnatbind$(exeext)): Use ggc-none.o.
(ada/utils.o): Update dependencies.
* gcc-interface/Makefile.in (EXTRA_GNATTOOLS_OBJS): Add
../../../libcpp/libcpp.a.
* gcc-interface/utils.c: Include common/common-target.h.
(process_attributes): Use targetm_common.have_named_sections.

c-family:
* c-common.c: Include common/common-target.h.
(handle_section_attribute): Use
targetm_common.have_named_sections.
* c-cppbuiltin.c: Include common/common-target.h.
(c_cpp_builtins): Use targetm_common.except_unwind_info.

cp:
* Make-lang.in (cp/method.o): Update dependencies.
* method.c: Include common/common-target.h.
(use_thunk): Use targetm_common.have_named_sections.

go:
* Make-lang.in (go/go-lang.o, go/go-backend.o): Update
dependencies.
* go-backend.c: Include common/common-target.h.
(go_write_export_data): Use targetm_common.have_named_sections.
* go-lang.c: Include common/common-target.h.
(go_langhook_init_options_struct): Use
targetm_common.supports_split_stack.

po:
* exgettext: Handle common/ directory and subdirectories.

From-SVN: r175064

124 files changed:
gcc/ChangeLog
gcc/Makefile.in
gcc/ada/ChangeLog
gcc/ada/gcc-interface/Make-lang.in
gcc/ada/gcc-interface/Makefile.in
gcc/ada/gcc-interface/utils.c
gcc/c-family/ChangeLog
gcc/c-family/c-common.c
gcc/c-family/c-cppbuiltin.c
gcc/cfglayout.c
gcc/cfgrtl.c
gcc/common/common-target-def.h
gcc/common/common-target.def
gcc/common/common-target.h
gcc/common/common-targhooks.c [new file with mode: 0644]
gcc/common/common-targhooks.h [new file with mode: 0644]
gcc/common/config/alpha/alpha-common.c [new file with mode: 0644]
gcc/common/config/arm/arm-common.c [new file with mode: 0644]
gcc/common/config/avr/avr-common.c [new file with mode: 0644]
gcc/common/config/bfin/bfin-common.c [new file with mode: 0644]
gcc/common/config/cris/cris-common.c [new file with mode: 0644]
gcc/common/config/default-common.c
gcc/common/config/fr30/fr30-common.c [new file with mode: 0644]
gcc/common/config/frv/frv-common.c [new file with mode: 0644]
gcc/common/config/h8300/h8300-common.c [new file with mode: 0644]
gcc/common/config/i386/i386-common.c [new file with mode: 0644]
gcc/common/config/ia64/ia64-common.c [new file with mode: 0644]
gcc/common/config/iq2000/iq2000-common.c [new file with mode: 0644]
gcc/common/config/lm32/lm32-common.c [new file with mode: 0644]
gcc/common/config/m32c/m32c-common.c [new file with mode: 0644]
gcc/common/config/m32r/m32r-common.c [new file with mode: 0644]
gcc/common/config/m68k/m68k-common.c [new file with mode: 0644]
gcc/common/config/mcore/mcore-common.c [new file with mode: 0644]
gcc/common/config/mep/mep-common.c [new file with mode: 0644]
gcc/common/config/microblaze/microblaze-common.c [new file with mode: 0644]
gcc/common/config/mips/mips-common.c [new file with mode: 0644]
gcc/common/config/mmix/mmix-common.c [new file with mode: 0644]
gcc/common/config/mn10300/mn10300-common.c [new file with mode: 0644]
gcc/common/config/pa/pa-common.c
gcc/common/config/pdp11/pdp11-common.c [new file with mode: 0644]
gcc/common/config/picochip/picochip-common.c [new file with mode: 0644]
gcc/common/config/rs6000/rs6000-common.c [new file with mode: 0644]
gcc/common/config/rx/rx-common.c [new file with mode: 0644]
gcc/common/config/s390/s390-common.c [new file with mode: 0644]
gcc/common/config/score/score-common.c [new file with mode: 0644]
gcc/common/config/sh/sh-common.c [new file with mode: 0644]
gcc/common/config/sparc/sparc-common.c [new file with mode: 0644]
gcc/common/config/spu/spu-common.c [new file with mode: 0644]
gcc/common/config/v850/v850-common.c [new file with mode: 0644]
gcc/common/config/vax/vax-common.c [new file with mode: 0644]
gcc/common/config/xstormy16/xstormy16-common.c [new file with mode: 0644]
gcc/common/config/xtensa/xtensa-common.c [new file with mode: 0644]
gcc/config.gcc
gcc/config/alpha/alpha.c
gcc/config/arm/arm-protos.h
gcc/config/arm/arm.c
gcc/config/avr/avr.c
gcc/config/bfin/bfin.c
gcc/config/bfin/bfin.h
gcc/config/cris/cris.c
gcc/config/fr30/fr30.c
gcc/config/frv/frv.c
gcc/config/h8300/h8300.c
gcc/config/i386/i386-protos.h
gcc/config/i386/i386.c
gcc/config/i386/t-i386
gcc/config/ia64/ia64-protos.h
gcc/config/ia64/ia64.c
gcc/config/iq2000/iq2000.c
gcc/config/lm32/lm32.c
gcc/config/m32c/m32c.c
gcc/config/m32r/m32r.c
gcc/config/m68k/m68k.c
gcc/config/mcore/mcore.c
gcc/config/mep/mep.c
gcc/config/microblaze/microblaze.c
gcc/config/mips/mips.c
gcc/config/mmix/mmix.c
gcc/config/mn10300/mn10300.c
gcc/config/pa/pa.c
gcc/config/pdp11/pdp11.c
gcc/config/picochip/picochip.c
gcc/config/rs6000/rs6000.c
gcc/config/rs6000/t-rs6000
gcc/config/rx/rx.c
gcc/config/s390/s390.c
gcc/config/s390/s390.h
gcc/config/score/score.c
gcc/config/sh/sh.c
gcc/config/sparc/sparc.c
gcc/config/spu/spu.c
gcc/config/stormy16/stormy16.c
gcc/config/v850/v850.c
gcc/config/vax/vax.c
gcc/config/xtensa/xtensa.c
gcc/cp/ChangeLog
gcc/cp/Make-lang.in
gcc/cp/method.c
gcc/dbxout.c
gcc/defaults.h
gcc/doc/tm.texi
gcc/dwarf2out.c
gcc/except.c
gcc/explow.c
gcc/expr.c
gcc/function.c
gcc/go/ChangeLog
gcc/go/Make-lang.in
gcc/go/go-backend.c
gcc/go/go-lang.c
gcc/haifa-sched.c
gcc/lto-opts.c
gcc/opts.c
gcc/po/ChangeLog
gcc/po/exgettext
gcc/target-def.h
gcc/target.def
gcc/target.h
gcc/targhooks.c
gcc/targhooks.h
gcc/toplev.c
gcc/tree-tailcall.c
gcc/tree.c
gcc/varasm.c

index ad5664b19a8996435ea1e351c907a88f57f57a0a..6d79df7313bc8f4e996fa862369665b1a99a17bf 100644 (file)
@@ -1,3 +1,304 @@
+2011-06-14  Joseph Myers  <joseph@codesourcery.com>
+
+       * target-def.h (TARGET_HAVE_NAMED_SECTIONS): Move to
+       common/common-target-def.h.
+       * target.def (default_target_flags, handle_option,
+       supports_split_stack, optimization_table, init_struct,
+       except_unwind_info, unwind_tables_default, have_named_sections):
+       Move to common/common-target.def.
+       * target.h (enum opt_levels, struct default_options): Move to
+       common/common-target.h.
+       * targhooks.c (default_except_unwind_info,
+       dwarf2_except_unwind_info, sjlj_except_unwind_info,
+       default_target_handle_option, empty_optimization_table): Move to
+       common/common-targhooks.c.
+       * targhooks.h (default_except_unwind_info,
+       dwarf2_except_unwind_info, sjlj_except_unwind_info,
+       default_target_handle_option, empty_optimization_table): Move to
+       common/common-targhooks.h.
+       * common/common-target-def.h: Include common/common-targhooks.h.
+       (TARGET_HAVE_NAMED_SECTIONS): Define if TARGET_ASM_NAMED_SECTION
+       defined.
+       * common/common-target.def (handle_option, option_init_struct,
+       option_optimization_table, default_target_flags,
+       except_unwind_info, supports_split_stack, unwind_tables_default,
+       have_named_sections): Move from target.def.
+       (HOOK_PREFIX): Undefine at end of file.
+       * common/common-target.h: Include input.h.
+       (enum opt_levels, struct default_options): Move from target.h.
+       * common/common-targhooks.c, common/common-targhooks.h: New.
+       * config.gcc (target_has_targetm_common): Default to yes.
+       (moxie*): Set target_has_targetm_common=no.
+       (hppa*-*-*): Don't set target_has_targetm_common=yes.
+       * doc/tm.texi: Regenerate.
+       * Makefile.in (COMMON_TARGET_H): Add $(INPUT_H).
+       (C_TARGET_DEF_H): Add common/common-targhooks.h.
+       (GCC_OBJS): Remove vec.o.
+       (OBJS): Remove hooks.o and vec.o.
+       (OBJS-libcommon-target): Add vec.o, hooks.o and
+       common/common-targhooks.o.
+       (c-family/c-common.o, c-family/c-cppbuiltin.o, lto-opts.o, tree.o,
+       tree-tailcall.o, opts.o, toplev.o, varasm.o, function.o, except.o,
+       expr.o, explow.o, dbxout.o, dwarf2out.o, cfgrtl.o, haifa-sched.o,
+       cfglayout.o, $(out_object_file), $(common_out_object_file)):
+       Update dependencies.
+       (common/common-targhooks.o): New.
+       * common/config/default-common.c: Include tm.h.  Add FIXME
+       comment.
+       * common/config/pa/pa-common.c: Include more headers.  Take
+       copyright dates from pa.c.
+       (pa_option_optimization_table, pa_handle_option,
+       TARGET_OPTION_OPTIMIZATION_TABLE, TARGET_DEFAULT_TARGET_FLAGS,
+       TARGET_HANDLE_OPTION): Move from pa.c.
+       * common/config/alpha/alpha-common.c,
+       common/config/arm/arm-common.c, common/config/avr/avr-common.c,
+       common/config/bfin/bfin-common.c,
+       common/config/cris/cris-common.c,
+       common/config/fr30/fr30-common.c, common/config/frv/frv-common.c,
+       common/config/h8300/h8300-common.c,
+       common/config/i386/i386-common.c,
+       common/config/ia64/ia64-common.c,
+       common/config/iq2000/iq2000-common.c,
+       common/config/lm32/lm32-common.c,
+       common/config/m32c/m32c-common.c,
+       common/config/m32r/m32r-common.c,
+       common/config/m68k/m68k-common.c,
+       common/config/mcore/mcore-common.c,
+       common/config/mep/mep-common.c,
+       common/config/microblaze/microblaze-common.c,
+       common/config/mips/mips-common.c,
+       common/config/mmix/mmix-common.c,
+       common/config/mn10300/mn10300-common.c,
+       common/config/pdp11/pdp11-common.c,
+       common/config/picochip/picochip-common.c,
+       common/config/rs6000/rs6000-common.c,
+       common/config/rx/rx-common.c, common/config/s390/s390-common.c,
+       common/config/score/score-common.c, common/config/sh/sh-common.c,
+       common/config/sparc/sparc-common.c,
+       common/config/spu/spu-common.c, common/config/v850/v850-common.c,
+       common/config/vax/vax-common.c,
+       common/config/xstormy16/xstormy16-common.c,
+       common/config/xtensa/xtensa-common.c: New.
+       * config/alpha/alpha.c: Include common/common-target.h.
+       (alpha_option_optimization_table, alpha_handle_option,
+       TARGET_DEFAULT_TARGET_FLAGS, TARGET_HANDLE_OPTION,
+       TARGET_OPTION_OPTIMIZATION_TABLE): Move to alpha-common.c.
+       * config/arm/arm-protos.h (arm_except_unwind_info): Declare.
+       * config/arm/arm.c (arm_option_optimization_table,
+       TARGET_DEFAULT_TARGET_FLAGS, TARGET_OPTION_OPTIMIZATION_TABLE,
+       TARGET_EXCEPT_UNWIND_INFO, arm_except_unwind_info): Move to
+       arm-common.c.
+       * config/avr/avr.c (avr_option_optimization_table,
+       TARGET_OPTION_OPTIMIZATION_TABLE, TARGET_EXCEPT_UNWIND_INFO): Move
+       to avr-common.c.
+       * config/bfin/bfin.c (struct bfin_cpu): Move to bfin.h.
+       (bfin_cpus, bfin_handle_option, TARGET_HANDLE_OPTION,
+       TARGET_DEFAULT_TARGET_FLAGS): Move to bfin-common.c.
+       * config/bfin/bfin.h struct bfin_cpu): Move from bfin.c.
+       * config/cris/cris.c (cris_option_optimization_table,
+       TARGET_DEFAULT_TARGET_FLAGS, TARGET_HANDLE_OPTION,
+       TARGET_OPTION_OPTIMIZATION_TABLE, cris_handle_option): Move to
+       cris-common.c.
+       * config/fr30/fr30.c (fr30_option_optimization_table,
+       TARGET_EXCEPT_UNWIND_INFO, TARGET_OPTION_OPTIMIZATION_TABLE): Move
+       to fr30-common.c.
+       * config/frv/frv.c (frv_option_optimization_table,
+       MASK_DEFAULT_ALLOC_CC, TARGET_DEFAULT_TARGET_FLAGS,
+       TARGET_OPTION_OPTIMIZATION_TABLE): Move to frv-common.c.
+       * config/h8300/h8300.c (h8300_option_optimization_table,
+       TARGET_DEFAULT_TARGET_FLAGS, TARGET_OPTION_OPTIMIZATION_TABLE,
+       TARGET_EXCEPT_UNWIND_INFO): Move to h8300-common.c.
+       * config/i386/i386-protos.h (ix86_handle_option): Declare.
+       * config/i386/i386.c: Include common/common-target.h.
+       (OPTION_MASK_ISA_MMX_SET, OPTION_MASK_ISA_3DNOW_SET,
+       OPTION_MASK_ISA_SSE_SET, OPTION_MASK_ISA_SSE2_SET,
+       OPTION_MASK_ISA_SSE3_SET, OPTION_MASK_ISA_SSSE3_SET,
+       OPTION_MASK_ISA_SSE4_1_SET, OPTION_MASK_ISA_SSE4_2_SET,
+       OPTION_MASK_ISA_AVX_SET, OPTION_MASK_ISA_FMA_SET,
+       OPTION_MASK_ISA_SSE4_SET, OPTION_MASK_ISA_SSE4A_SET,
+       OPTION_MASK_ISA_FMA4_SET, OPTION_MASK_ISA_XOP_SET,
+       OPTION_MASK_ISA_LWP_SET, OPTION_MASK_ISA_AES_SET,
+       OPTION_MASK_ISA_PCLMUL_SET, OPTION_MASK_ISA_ABM_SET,
+       OPTION_MASK_ISA_BMI_SET, OPTION_MASK_ISA_TBM_SET,
+       OPTION_MASK_ISA_POPCNT_SET, OPTION_MASK_ISA_CX16_SET,
+       OPTION_MASK_ISA_SAHF_SET, OPTION_MASK_ISA_MOVBE_SET,
+       OPTION_MASK_ISA_CRC32_SET, OPTION_MASK_ISA_FSGSBASE_SET,
+       OPTION_MASK_ISA_RDRND_SET, OPTION_MASK_ISA_F16C_SET,
+       OPTION_MASK_ISA_MMX_UNSET, OPTION_MASK_ISA_3DNOW_UNSET,
+       OPTION_MASK_ISA_3DNOW_A_UNSET, OPTION_MASK_ISA_SSE_UNSET,
+       OPTION_MASK_ISA_SSE2_UNSET, OPTION_MASK_ISA_SSE3_UNSET,
+       OPTION_MASK_ISA_SSSE3_UNSET, OPTION_MASK_ISA_SSE4_1_UNSET,
+       OPTION_MASK_ISA_SSE4_2_UNSET, OPTION_MASK_ISA_AVX_UNSET,
+       OPTION_MASK_ISA_FMA_UNSET, OPTION_MASK_ISA_SSE4_UNSET,
+       OPTION_MASK_ISA_SSE4A_UNSET, OPTION_MASK_ISA_FMA4_UNSET,
+       OPTION_MASK_ISA_XOP_UNSET, OPTION_MASK_ISA_LWP_UNSET,
+       OPTION_MASK_ISA_AES_UNSET, OPTION_MASK_ISA_PCLMUL_UNSET,
+       OPTION_MASK_ISA_ABM_UNSET, OPTION_MASK_ISA_BMI_UNSET,
+       OPTION_MASK_ISA_TBM_UNSET, OPTION_MASK_ISA_POPCNT_UNSET,
+       OPTION_MASK_ISA_CX16_UNSET, OPTION_MASK_ISA_SAHF_UNSET,
+       OPTION_MASK_ISA_MOVBE_UNSET, OPTION_MASK_ISA_CRC32_UNSET,
+       OPTION_MASK_ISA_FSGSBASE_UNSET, OPTION_MASK_ISA_RDRND_UNSET,
+       OPTION_MASK_ISA_F16C_UNSET, ix86_handle_option,
+       ix86_option_optimization_table, ix86_option_init_struct,
+       ix86_supports_split_stack, TARGET_DEFAULT_TARGET_FLAGS,
+       TARGET_HANDLE_OPTION, TARGET_OPTION_OPTIMIZATION_TABLE,
+       TARGET_OPTION_INIT_STRUCT, TARGET_SUPPORTS_SPLIT_STACK): Move to
+       i386-common.c.
+       * config/i386/t-i386 (i386.o): Update dependencies.
+       * config/ia64/ia64-protos.h (ia64_except_unwind_info): Declare.
+       * config/ia64/ia64.c (ia64_option_optimization_table,
+       TARGET_OPTION_OPTIMIZATION_TABLE, TARGET_EXCEPT_UNWIND_INFO,
+       TARGET_DEFAULT_TARGET_FLAGS, TARGET_HANDLE_OPTION,
+       ia64_handle_option): Move to ia64-common.c.
+       * config/iq2000/iq2000.c (iq2000_option_optimization_table,
+       TARGET_OPTION_OPTIMIZATION_TABLE): Move to iq2000-common.c.
+       * config/lm32/lm32.c (lm32_option_optimization_table,
+       TARGET_OPTION_OPTIMIZATION_TABLE, TARGET_EXCEPT_UNWIND_INFO): Move
+       to lm32-common.c.
+       * config/m32c/m32c.c (TARGET_HAVE_NAMED_SECTIONS): Move to
+       m32c-common.c.
+       * config/m32r/m32r.c (m32r_option_optimization_table,
+       TARGET_DEFAULT_TARGET_FLAGS, TARGET_HANDLE_OPTION,
+       TARGET_OPTION_OPTIMIZATION_TABLE, TARGET_EXCEPT_UNWIND_INFO,
+       m32r_handle_option): Move to m32r-common.c.
+       (m32r_memory_move_cost): Remove comment referring to
+       TARGET_HANDLE_OPTION.
+       * config/m68k/m68k.c (TARGET_HANDLE_OPTION, m68k_handle_option):
+       Move to m68k-common.c.
+       * config/mcore/mcore.c (mcore_option_optimization_table,
+       TARGET_DEFAULT_TARGET_FLAGS, TARGET_OPTION_OPTIMIZATION_TABLE,
+       TARGET_EXCEPT_UNWIND_INFO): Move to mcore-common.c.
+       * config/mep/mep.c (mep_option_optimization_table,
+       mep_handle_option, TARGET_HANDLE_OPTION,
+       TARGET_OPTION_OPTIMIZATION_TABLE, TARGET_DEFAULT_TARGET_FLAGS):
+       Move to mep-common.c.
+       * config/microblaze/microblaze.c
+       (microblaze_option_optimization_table,
+       TARGET_DEFAULT_TARGET_FLAGS, TARGET_OPTION_OPTIMIZATION_TABLE,
+       TARGET_EXCEPT_UNWIND_INFO): Move to microblaze-common.c.
+       * config/mips/mips.c (mips_handle_option,
+       mips_option_optimization_table, TARGET_OPTION_OPTIMIZATION_TABLE,
+       TARGET_DEFAULT_TARGET_FLAGS, TARGET_HANDLE_OPTION): Move to
+       mips-common.c.
+       * config/mmix/mmix.c (mmix_option_optimization_table,
+       TARGET_DEFAULT_TARGET_FLAGS, TARGET_OPTION_OPTIMIZATION_TABLE):
+       Move to mmix-common.c.
+       * config/mn10300/mn10300.c (mn10300_option_optimization_table,
+       mn10300_handle_option, TARGET_EXCEPT_UNWIND_INFO,
+       TARGET_DEFAULT_TARGET_FLAGS, TARGET_HANDLE_OPTION,
+       TARGET_OPTION_OPTIMIZATION_TABLE): Move to mn10300-common.c.
+       * config/pa/pa.c: Include common/common-target.h.
+       (pa_option_optimization_table, TARGET_OPTION_OPTIMIZATION_TABLE,
+       TARGET_DEFAULT_TARGET_FLAGS, TARGET_HANDLE_OPTION,
+       pa_handle_option): Move to pa-common.c.
+       (pa_option_override): Use targetm_common.except_unwind_info.
+       (pa_asm_output_mi_thunk, pa_function_section): Use
+       targetm_common.have_named_sections.
+       * config/pdp11/pdp11.c (pdp11_option_optimization_table,
+       TARGET_DEFAULT_TARGET_FLAGS, TARGET_HANDLE_OPTION,
+       TARGET_OPTION_OPTIMIZATION_TABLE, TARGET_OPTION_INIT_STRUCT,
+       pdp11_handle_option, pdp11_option_init_struct): Move to
+       pdp11-common.c.
+       * config/picochip/picochip.c (picochip_option_optimization_table,
+       TARGET_HAVE_NAMED_SECTIONS, TARGET_OPTION_OPTIMIZATION_TABLE,
+       TARGET_EXCEPT_UNWIND_INFO): Move to picochip-common.c.
+       * config/rs6000/rs6000.c: Include common/common-target.h.
+       (rs6000_option_optimization_table, TARGET_HANDLE_OPTION,
+       TARGET_OPTION_INIT_STRUCT, TARGET_OPTION_OPTIMIZATION_TABLE,
+       TARGET_DEFAULT_TARGET_FLAGS, rs6000_option_init_struct,
+       rs6000_handle_option): Move to rs6000-common.c.
+       * config/rs6000/t-rs6000 (rs6000.o): Update dependencies.
+       * config/rx/rx.c (rx_handle_option, rx_option_optimization_table,
+       TARGET_HANDLE_OPTION, TARGET_OPTION_OPTIMIZATION_TABLE,
+       TARGET_EXCEPT_UNWIND_INFO): Move to rx-common.c.
+       * config/s390/s390.c (processor_flags_table,
+       s390_option_optimization_table, s390_option_init_struct,
+       s390_handle_option, TARGET_DEFAULT_TARGET_FLAGS,
+       TARGET_HANDLE_OPTION, TARGET_OPTION_OPTIMIZATION_TABLE,
+       TARGET_OPTION_INIT_STRUCT): Move to s390-common.c.
+       * config/s390/s390.h (processor_flags_table): Declare.
+       * config/score/score.c (score_option_optimization_table,
+       TARGET_DEFAULT_TARGET_FLAGS, TARGET_HANDLE_OPTION,
+       TARGET_OPTION_OPTIMIZATION_TABLE, MASK_ALL_CPU_BITS,
+       score_handle_option): Move to score-common.c.
+       * config/sh/sh.c (sh_option_optimization_table,
+       TARGET_OPTION_OPTIMIZATION_TABLE, TARGET_OPTION_INIT_STRUCT,
+       TARGET_DEFAULT_TARGET_FLAGS, TARGET_HANDLE_OPTION,
+       sh_handle_option, sh_option_init_struct): Move to sh-common.c.
+       * config/sparc/sparc.c: Include common/common-target.h.
+       (sparc_option_optimization_table, TARGET_DEFAULT_TARGET_FLAGS,
+       TARGET_OPTION_OPTIMIZATION_TABLE): Move to sparc-common.c.
+       * config/spu/spu.c (TARGET_DEFAULT_TARGET_FLAGS,
+       TARGET_OPTION_INIT_STRUCT, TARGET_EXCEPT_UNWIND_INFO,
+       spu_option_init_struct): Move to spu-common.c.
+       * config/stormy16/stormy16.c (xstorym16_option_optimization_table,
+       TARGET_OPTION_OPTIMIZATION_TABLE): Move to xstormy16-common.c.
+       * config/v850/v850.c (small_memory_physical_max,
+       v850_handle_memory_optionn v850_handle_option,
+       v850_option_optimization_table, TARGET_DEFAULT_TARGET_FLAGS,
+       TARGET_HANDLE_OPTION, TARGET_OPTION_OPTIMIZATION_TABLE): Move to
+       v850-common.c.
+       * config/vax/vax.c (TARGET_DEFAULT_TARGET_FLAGS): Move to
+       vax-common.c.
+       * config/xtensa/xtensa.c (xtensa_option_optimization_table,
+       TARGET_DEFAULT_TARGET_FLAGS, TARGET_OPTION_OPTIMIZATION_TABLE):
+       Move to xtensa-common.c.
+       * cfglayout.c: Include common/common-target.h.
+       (fixup_reorder_chain): Use targetm_common.have_named_sections.
+       * cfgrtl.c: Include common/common-target.h.
+       (force_nonfallthru_and_redirect, commit_one_edge_insertion): Use
+       targetm_common.have_named_sections.
+       * dbxout.c: Include common/common-target.h.
+       (dbxout_function_end): Use targetm_common.have_named_sections.
+       * defaults.h (STACK_OLD_CHECK_PROTECT, STACK_CHECK_PROTECT): Use
+       targetm_common.except_unwind_info.
+       * dwarf2out.c: Include common/common-target.h.
+       (dwarf2out_do_frame, dwarf2out_do_cfi_asm,
+       dwarf2out_begin_prologue, dwarf2out_frame_init,
+       dwarf2out_frame_finish, dwarf2out_assembly_start): Use
+       targetm_common.except_unwind_info.
+       * except.c: Include common/common-target.h.
+       (init_eh, finish_eh_generation,
+       output_one_function_exception_table): Use
+       targetm_common.except_unwind_info.
+       (switch_to_exception_section): Use
+       targetm_common.have_named_sections.
+       * explow.c: Include common/common-target.h.
+       * expr.c: Include common/common-target.h.
+       (build_personality_function): Use
+       targetm_common.except_unwind_info.
+       * function.c: Include common/common-target.h.
+       (expand_function_end): Use targetm_common.except_unwind_info.
+       * haifa-sched.c: Include common/common-target.h.
+       (sched_create_recovery_edges): Use
+       targetm_common.have_named_sections.
+       * lto-opts.c: Include common/common-target.h instead of target.h.
+       (lto_reissue_options): Use targetm_common.handle_option.
+       * opts.c: Include common/common-target.h.
+       (target_handle_option): Use targetm_common.handle_option.
+       (init_options_struct): Update comment referring to
+       targetm.target_option.optimization.  Use
+       targetm_common.default_target_flags,
+       targetm_common.unwind_tables_default and
+       targetm_common.option_init_struct.
+       (default_options_optimization): Use
+       targetm_common.option_optimization_table.
+       (finish_options): Use targetm_common.except_unwind_info,
+       targetm_common.unwind_tables_default,
+       targetm_common.have_named_sections and
+       targetm_common.supports_split_stack.
+       * toplev.c: Include common/common-target.h.
+       (process_options): Use targetm_common.have_named_sections.
+       * tree-tailcall.c: Include common/common-target.h.
+       (suitable_for_tail_call_opt_p): Use
+       targetm_common.except_unwind_info.
+       * tree.c: Include common/common-target.h.
+       (build_common_builtin_nodes): Use
+       targetm_common.except_unwind_info.
+       * varasm.c: Include common/common-target.h.
+       (resolve_unique_section, hot_function_section,
+       default_function_section): Use targetm_common.have_named_sections.
+
 2011-06-14  Easwaran Raman  <eraman@google.com>
 
        PR rtl-optimization/44194
index 2f9610a1e58bb06a9d25a36d470a34ebc5d63002..09f8e8e9eec47b6a14837fe43fd13d6c8f9018af 100644 (file)
@@ -893,14 +893,14 @@ C_TARGET_DEF = c-family/c-target.def target-hooks-macros.h
 COMMON_TARGET_DEF = common/common-target.def target-hooks-macros.h
 TARGET_H = $(TM_H) target.h $(TARGET_DEF) insn-modes.h
 C_TARGET_H = c-family/c-target.h $(C_TARGET_DEF)
-COMMON_TARGET_H = common/common-target.h $(COMMON_TARGET_DEF)
+COMMON_TARGET_H = common/common-target.h $(INPUT_H) $(COMMON_TARGET_DEF)
 MACHMODE_H = machmode.h mode-classes.def insn-modes.h
 HOOKS_H = hooks.h $(MACHMODE_H)
 HOSTHOOKS_DEF_H = hosthooks-def.h $(HOOKS_H)
 LANGHOOKS_DEF_H = langhooks-def.h $(HOOKS_H)
 TARGET_DEF_H = target-def.h target-hooks-def.h $(HOOKS_H) targhooks.h
 C_TARGET_DEF_H = c-family/c-target-def.h c-family/c-target-hooks-def.h \
-  $(TREE_H) $(C_COMMON_H) $(HOOKS_H)
+  $(TREE_H) $(C_COMMON_H) $(HOOKS_H) common/common-targhooks.h
 COMMON_TARGET_DEF_H = common/common-target-def.h \
   common/common-target-hooks-def.h $(HOOKS_H)
 RTL_BASE_H = rtl.h rtl.def $(MACHMODE_H) reg-notes.def insn-notes.def \
@@ -1173,7 +1173,7 @@ CXX_TARGET_OBJS=@cxx_target_objs@
 FORTRAN_TARGET_OBJS=@fortran_target_objs@
 
 # Object files for gcc driver.
-GCC_OBJS = gcc.o vec.o ggc-none.o
+GCC_OBJS = gcc.o ggc-none.o
 
 # Language-specific object files shared by all C-family front ends.
 C_COMMON_OBJS = c-family/c-common.o c-family/c-cppbuiltin.o c-family/c-dump.o \
@@ -1292,7 +1292,6 @@ OBJS = \
        graphite-sese-to-poly.o \
        gtype-desc.o \
        haifa-sched.o \
-       hooks.o \
        hwint.o \
        ifcvt.o \
        implicit-zee.o \
@@ -1484,7 +1483,6 @@ OBJS = \
        var-tracking.o \
        varasm.o \
        varpool.o \
-       vec.o \
        vmsdbgout.o \
        web.o \
        xcoffout.o \
@@ -1499,7 +1497,7 @@ OBJS-libcommon = diagnostic.o pretty-print.o intl.o input.o version.o
 # Objects in libcommon-target.a, used by drivers and by the core
 # compiler and containing target-dependent code.
 OBJS-libcommon-target = $(common_out_object_file) prefix.o opts-common.o \
-       options.o
+       options.o vec.o hooks.o common/common-targhooks.o
 
 # This lists all host objects for the front ends.
 ALL_HOST_FRONTEND_OBJS = $(C_OBJS) \
@@ -2144,11 +2142,11 @@ c-family/c-common.o : c-family/c-common.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \
        intl.h $(OPTS_H) $(CPPLIB_H) $(TREE_INLINE_H) $(HASHTAB_H) \
        $(BUILTINS_DEF) $(CGRAPH_H) $(BASIC_BLOCK_H) $(TARGET_DEF_H) \
        $(LIBFUNCS_H) \
-       gt-c-family-c-common.h
+       gt-c-family-c-common.h $(COMMON_TARGET_H)
 
 c-family/c-cppbuiltin.o : c-family/c-cppbuiltin.c $(CONFIG_H) $(SYSTEM_H) \
        coretypes.h $(TM_H) $(TREE_H) version.h $(C_COMMON_H) $(C_PRAGMA_H) \
-       $(FLAGS_H) output.h $(TREE_H) $(TARGET_H) \
+       $(FLAGS_H) output.h $(TREE_H) $(TARGET_H) $(COMMON_TARGET_H) \
        $(TM_P_H) debug.h $(CPP_ID_DATA_H) cppbuiltin.h
        $(COMPILER) -c $(ALL_COMPILERFLAGS) $(ALL_CPPFLAGS) \
                $< $(OUTPUT_OPTION)
@@ -2389,7 +2387,7 @@ lto-symtab.o: lto-symtab.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \
    $(LTO_STREAMER_H) $(LINKER_PLUGIN_API_H) gt-lto-symtab.h
 lto-opts.o: lto-opts.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TREE_H) \
    $(HASHTAB_H) $(GGC_H) $(BITMAP_H) $(FLAGS_H) $(OPTS_H) $(OPTIONS_H) \
-   $(TARGET_H) $(DIAGNOSTIC_H) $(LTO_STREAMER_H)
+   $(COMMON_TARGET_H) $(DIAGNOSTIC_H) $(LTO_STREAMER_H)
 lto-streamer.o: lto-streamer.c $(CONFIG_H) $(SYSTEM_H) coretypes.h   \
    $(TM_H) $(TREE_H) $(GIMPLE_H) $(BITMAP_H) $(LTO_STREAMER_H) $(FLAGS_H) \
    $(TREE_FLOW_H) $(DIAGNOSTIC_CORE_H) $(LTO_SYMTAB_H) toplev.h $(DIAGNOSTIC_CORE_H)
@@ -2403,7 +2401,8 @@ tree.o: tree.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(TREE_H) \
    langhooks.h gt-tree.h $(TREE_INLINE_H) tree-iterator.h \
    $(BASIC_BLOCK_H) $(TREE_FLOW_H) $(OBSTACK_H) pointer-set.h \
    tree-pass.h $(LANGHOOKS_DEF_H) $(DIAGNOSTIC_H) $(CGRAPH_H) $(TIMEVAR_H) \
-   $(EXCEPT_H) debug.h intl.h tree-diagnostic.h tree-pretty-print.h
+   $(EXCEPT_H) debug.h intl.h tree-diagnostic.h tree-pretty-print.h \
+   $(COMMON_TARGET_H)
 tree-dump.o: tree-dump.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \
    $(TREE_H) langhooks.h toplev.h $(SPLAY_TREE_H) $(TREE_DUMP_H) \
    tree-iterator.h $(TREE_PASS_H) $(DIAGNOSTIC_H)
@@ -2568,7 +2567,8 @@ tree-cfgcleanup.o : tree-cfgcleanup.c $(TREE_FLOW_H) $(CONFIG_H) $(SYSTEM_H) \
 tree-tailcall.o : tree-tailcall.c $(TREE_FLOW_H) $(CONFIG_H) $(SYSTEM_H) \
    $(TREE_H) $(TM_P_H) $(FUNCTION_H) $(TM_H) coretypes.h \
    $(TREE_DUMP_H) $(DIAGNOSTIC_H) $(EXCEPT_H) $(TREE_PASS_H) $(FLAGS_H) langhooks.h \
-   $(BASIC_BLOCK_H) $(DBGCNT_H) gimple-pretty-print.h $(TARGET_H)
+   $(BASIC_BLOCK_H) $(DBGCNT_H) gimple-pretty-print.h $(TARGET_H) \
+   $(COMMON_TARGET_H)
 tree-ssa-sink.o : tree-ssa-sink.c $(TREE_FLOW_H) $(CONFIG_H) \
    $(SYSTEM_H) $(TREE_H) $(DIAGNOSTIC_H) $(TIMEVAR_H) \
    $(TM_H) coretypes.h $(TREE_DUMP_H) $(TREE_PASS_H) $(FLAGS_H) alloc-pool.h \
@@ -2842,7 +2842,7 @@ diagnostic.o : diagnostic.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \
    version.h $(INPUT_H) intl.h $(DIAGNOSTIC_H) diagnostic.def
 opts.o : opts.c $(OPTS_H) $(OPTIONS_H) $(DIAGNOSTIC_CORE_H) $(CONFIG_H) $(SYSTEM_H) \
    coretypes.h $(TM_H) $(RTL_H) \
-   $(DIAGNOSTIC_H) $(INSN_ATTR_H) intl.h $(TARGET_H) \
+   $(DIAGNOSTIC_H) $(INSN_ATTR_H) intl.h $(TARGET_H) $(COMMON_TARGET_H) \
    $(FLAGS_H) $(PARAMS_H) opts-diagnostic.h
 opts-global.o : opts-global.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \
    $(DIAGNOSTIC_H) $(OPTS_H) $(FLAGS_H) $(GGC_H) $(TREE_H) langhooks.h \
@@ -2855,6 +2855,8 @@ targhooks.o : targhooks.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TREE_H) \
    $(MACHMODE_H) $(TARGET_DEF_H) $(TARGET_H) $(GGC_H) gt-targhooks.h \
    $(OPTABS_H) $(RECOG_H) reload.h hard-reg-set.h intl.h $(OPTS_H) \
    tree-ssa-alias.h $(TREE_FLOW_H)
+common/common-targhooks.o : common/common-targhooks.c $(CONFIG_H) $(SYSTEM_H) \
+   coretypes.h $(INPUT_H) $(TM_H) $(COMMON_TARGET_H) common/common-targhooks.h
 
 bversion.h: s-bversion; @true
 s-bversion: BASE-VER
@@ -2876,7 +2878,7 @@ toplev.o : toplev.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(TREE_H) \
    $(CGRAPH_H) $(COVERAGE_H) alloc-pool.h $(GGC_H) $(INTEGRATE_H) \
    $(OPTS_H) params.def tree-mudflap.h $(TREE_PASS_H) $(GIMPLE_H) \
    tree-ssa-alias.h $(PLUGIN_H) realmpfr.h tree-diagnostic.h \
-   tree-pretty-print.h opts-diagnostic.h
+   tree-pretty-print.h opts-diagnostic.h $(COMMON_TARGET_H)
        $(COMPILER) $(ALL_COMPILERFLAGS) $(ALL_CPPFLAGS) \
          -DTARGET_NAME=\"$(target_noncanonical)\" \
          -c $(srcdir)/toplev.c $(OUTPUT_OPTION)
@@ -2923,13 +2925,13 @@ varasm.o : varasm.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(TREE_H) \
    output.h $(DIAGNOSTIC_CORE_H) xcoffout.h debug.h $(GGC_H) $(TM_P_H) \
    $(HASHTAB_H) $(TARGET_H) langhooks.h gt-varasm.h $(BASIC_BLOCK_H) \
    $(CFGLAYOUT_H) $(CGRAPH_H) targhooks.h tree-mudflap.h \
-   tree-iterator.h pointer-set.h
+   tree-iterator.h pointer-set.h $(COMMON_TARGET_H)
 function.o : function.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_ERROR_H) \
    $(TREE_H) $(CFGLAYOUT_H) $(GIMPLE_H) $(FLAGS_H) $(FUNCTION_H) $(EXPR_H) \
    $(OPTABS_H) $(LIBFUNCS_H) $(REGS_H) hard-reg-set.h insn-config.h $(RECOG_H) \
    output.h  $(EXCEPT_H) $(HASHTAB_H) $(GGC_H) $(TM_P_H) langhooks.h \
    gt-function.h $(TARGET_H) $(BASIC_BLOCK_H) $(INTEGRATE_H) $(PREDICT_H) \
-   $(TREE_PASS_H) $(DF_H) $(TIMEVAR_H) vecprim.h
+   $(TREE_PASS_H) $(DF_H) $(TIMEVAR_H) vecprim.h $(COMMON_TARGET_H)
 statistics.o : statistics.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \
    $(TREE_PASS_H) $(TREE_DUMP_H) $(HASHTAB_H) statistics.h $(FUNCTION_H)
 stmt.o : stmt.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) \
@@ -2944,14 +2946,15 @@ except.o : except.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) \
    dwarf2asm.h dwarf2out.h toplev.h $(DIAGNOSTIC_CORE_H) $(HASHTAB_H) intl.h $(GGC_H) \
    gt-except.h $(CGRAPH_H) $(INTEGRATE_H) $(DIAGNOSTIC_H) $(DWARF2_H) \
    $(TARGET_H) $(TM_P_H) $(TREE_PASS_H) $(TIMEVAR_H) $(TREE_FLOW_H) \
-   tree-pretty-print.h sbitmap.h
+   tree-pretty-print.h sbitmap.h $(COMMON_TARGET_H)
 expr.o : expr.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) \
    $(TREE_H) $(FLAGS_H) $(FUNCTION_H) $(REGS_H) $(EXPR_H) $(OPTABS_H) \
    $(LIBFUNCS_H) $(INSN_ATTR_H) insn-config.h $(RECOG_H) output.h \
    typeclass.h hard-reg-set.h toplev.h $(DIAGNOSTIC_CORE_H) hard-reg-set.h $(EXCEPT_H) \
    reload.h langhooks.h intl.h $(TM_P_H) $(TARGET_H) \
    tree-iterator.h gt-expr.h $(MACHMODE_H) $(TIMEVAR_H) $(TREE_FLOW_H) \
-   $(TREE_PASS_H) $(DF_H) $(DIAGNOSTIC_H) vecprim.h $(SSAEXPAND_H)
+   $(TREE_PASS_H) $(DF_H) $(DIAGNOSTIC_H) vecprim.h $(SSAEXPAND_H) \
+   $(COMMON_TARGET_H)
 dojump.o : dojump.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) $(TREE_H) \
    $(FLAGS_H) $(FUNCTION_H) $(EXPR_H) $(OPTABS_H) $(INSN_ATTR_H) insn-config.h \
    langhooks.h $(GGC_H) gt-dojump.h vecprim.h $(BASIC_BLOCK_H) output.h
@@ -2974,7 +2977,7 @@ expmed.o : expmed.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) $(TREE_
 explow.o : explow.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) $(TREE_H) \
    $(FLAGS_H) hard-reg-set.h insn-config.h $(EXPR_H) $(OPTABS_H) $(RECOG_H) \
    $(DIAGNOSTIC_CORE_H) $(EXCEPT_H) $(FUNCTION_H) $(GGC_H) $(TM_P_H) langhooks.h gt-explow.h \
-   $(TARGET_H) output.h
+   $(TARGET_H) $(COMMON_TARGET_H) output.h
 optabs.o : optabs.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) \
    $(TREE_H) $(FLAGS_H) insn-config.h $(EXPR_H) $(OPTABS_H) $(LIBFUNCS_H) \
    $(RECOG_H) reload.h $(DIAGNOSTIC_CORE_H) $(GGC_H) $(TM_P_H) \
@@ -2983,7 +2986,7 @@ dbxout.o : dbxout.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(TREE_H) \
    $(RTL_H) $(FLAGS_H) $(REGS_H) debug.h $(TM_P_H) $(TARGET_H) $(FUNCTION_H) \
    langhooks.h insn-config.h reload.h $(GSTAB_H) xcoffout.h output.h dbxout.h \
    toplev.h $(DIAGNOSTIC_CORE_H) $(GGC_H) $(OBSTACK_H) $(EXPR_H) $(CGRAPH_H) \
-   gt-dbxout.h
+   gt-dbxout.h $(COMMON_TARGET_H)
 debug.o : debug.c debug.h $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(TREE_H)
 sdbout.o : sdbout.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) debug.h \
    $(TREE_H) $(GGC_H) $(RTL_H) $(REGS_H) $(FLAGS_H) insn-config.h \
@@ -2995,7 +2998,8 @@ dwarf2out.o : dwarf2out.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \
    $(LIBFUNCS_H) toplev.h $(DIAGNOSTIC_CORE_H) dwarf2out.h reload.h \
    $(GGC_H) $(EXCEPT_H) dwarf2asm.h $(TM_P_H) langhooks.h $(HASHTAB_H) \
    gt-dwarf2out.h $(TARGET_H) $(CGRAPH_H) $(MD5_H) $(INPUT_H) $(FUNCTION_H) \
-   $(GIMPLE_H) $(TREE_PASS_H) $(TREE_FLOW_H) $(CFGLAYOUT_H) tree-pretty-print.h
+   $(GIMPLE_H) $(TREE_PASS_H) $(TREE_FLOW_H) $(CFGLAYOUT_H) \
+   tree-pretty-print.h $(COMMON_TARGET_H)
 dwarf2asm.o : dwarf2asm.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \
    $(FLAGS_H) $(RTL_H) $(TREE_H) output.h dwarf2asm.h $(TM_P_H) $(GGC_H) \
    gt-dwarf2asm.h $(DWARF2_H) $(SPLAY_TREE_H) $(TARGET_H)
@@ -3273,7 +3277,7 @@ cfgrtl.o : cfgrtl.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_ERROR_H) \
    output.h  $(FUNCTION_H) $(EXCEPT_H) $(TM_P_H) $(INSN_ATTR_H) \
    insn-config.h $(EXPR_H) \
    $(CFGLAYOUT_H) $(CFGLOOP_H) $(OBSTACK_H) $(TARGET_H) $(TREE_H) \
-   $(TREE_PASS_H) $(DF_H) $(GGC_H)
+   $(TREE_PASS_H) $(DF_H) $(GGC_H) $(COMMON_TARGET_H)
 cfganal.o : cfganal.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) \
    $(BASIC_BLOCK_H) hard-reg-set.h insn-config.h $(RECOG_H) $(TM_P_H) \
    $(TIMEVAR_H) $(OBSTACK_H) $(DIAGNOSTIC_CORE_H) vecprim.h sbitmap.h $(BITMAP_H)
@@ -3436,7 +3440,7 @@ modulo-sched.o : modulo-sched.c $(DDG_H) $(CONFIG_H) $(CONFIG_H) $(SYSTEM_H) \
 haifa-sched.o : haifa-sched.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) \
    $(SCHED_INT_H) $(REGS_H) hard-reg-set.h $(FLAGS_H) insn-config.h $(FUNCTION_H) \
    $(INSN_ATTR_H) $(DIAGNOSTIC_CORE_H) $(RECOG_H) $(EXCEPT_H) $(TM_P_H) $(TARGET_H) output.h \
-   $(PARAMS_H) $(DBGCNT_H) $(CFGLOOP_H) ira.h $(EMIT_RTL_H)
+   $(PARAMS_H) $(DBGCNT_H) $(CFGLOOP_H) ira.h $(EMIT_RTL_H) $(COMMON_TARGET_H)
 sched-deps.o : sched-deps.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \
    $(RTL_H) $(SCHED_INT_H) $(REGS_H) hard-reg-set.h $(FLAGS_H) insn-config.h \
    $(FUNCTION_H) $(INSN_ATTR_H) $(DIAGNOSTIC_CORE_H) $(RECOG_H) $(EXCEPT_H) cselib.h \
@@ -3510,7 +3514,7 @@ cfglayout.o : cfglayout.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \
    $(RTL_H) $(TREE_H) insn-config.h $(BASIC_BLOCK_H) hard-reg-set.h output.h \
    $(FUNCTION_H) $(CFGLAYOUT_H) $(CFGLOOP_H) $(TARGET_H) gt-cfglayout.h \
    $(GGC_H) alloc-pool.h $(FLAGS_H) $(OBSTACK_H) $(TREE_PASS_H) vecprim.h \
-   $(DF_H) $(EMIT_RTL_H)
+   $(DF_H) $(EMIT_RTL_H) $(COMMON_TARGET_H)
 timevar.o : timevar.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \
    $(TIMEVAR_H) $(FLAGS_H) intl.h toplev.h $(DIAGNOSTIC_CORE_H) $(RTL_H) timevar.def
 regcprop.o : regcprop.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \
@@ -3547,12 +3551,13 @@ $(out_object_file): $(out_file) $(CONFIG_H) coretypes.h $(TM_H) $(TREE_H) \
    output.h $(INSN_ATTR_H) $(SYSTEM_H) toplev.h $(DIAGNOSTIC_CORE_H) \
    $(TARGET_H) $(LIBFUNCS_H) $(TARGET_DEF_H) $(FUNCTION_H) $(SCHED_INT_H) \
    $(TM_P_H) $(EXPR_H) langhooks.h $(GGC_H) $(OPTABS_H) $(REAL_H) \
-   tm-constrs.h $(GIMPLE_H) $(DF_H) cselib.h
+   tm-constrs.h $(GIMPLE_H) $(DF_H) cselib.h $(COMMON_TARGET_H)
        $(COMPILER) -c $(ALL_COMPILERFLAGS) $(ALL_CPPFLAGS) \
                $(out_file) $(OUTPUT_OPTION)
 
 $(common_out_object_file): $(common_out_file) $(CONFIG_H) $(SYSTEM_H) \
-    coretypes.h $(COMMON_TARGET_H) $(COMMON_TARGET_DEF_H) $(TM_H)
+    coretypes.h $(COMMON_TARGET_H) $(COMMON_TARGET_DEF_H) \
+    $(DIAGNOSTIC_CORE_H) $(FLAGS_H) $(OPTS_H) $(TM_H) $(TM_P_H) $(MACHMODE_H)
        $(COMPILER) -c $(ALL_COMPILERFLAGS) $(ALL_CPPFLAGS) \
          $< $(OUTPUT_OPTION)
 
index bab86659a0f036bf01c930c59ad17f4ecea17532..eb39be4b6bba3944237847e810ba156a1dcf0239 100644 (file)
@@ -1,3 +1,12 @@
+2011-06-14  Joseph Myers  <joseph@codesourcery.com>
+
+       * gcc-interface/Make-lang.in (gnatbind$(exeext)): Use ggc-none.o.
+       (ada/utils.o): Update dependencies.
+       * gcc-interface/Makefile.in (EXTRA_GNATTOOLS_OBJS): Add
+       ../../../libcpp/libcpp.a.
+       * gcc-interface/utils.c: Include common/common-target.h.
+       (process_attributes): Use targetm_common.have_named_sections.
+
 2011-06-07  Richard Guenther  <rguenther@suse.de>
 
        * gcc-interface/misc.c (gnat_init): Do not set size_type_node or call
index 53f9f8d3f1a2d0177d54036029ef263e7ab6fa51..2e73363298bfdb24ea84eee3a007c0608d1a753d 100644 (file)
@@ -479,8 +479,8 @@ gnat1$(exeext): $(TARGET_ADA_SRCS) $(GNAT1_OBJS) $(ADA_BACKEND) libcommon-target
        $(GCC_LINK) -o $@ $(GNAT1_OBJS) $(ADA_BACKEND) libcommon-target.a $(LIBS) $(SYSLIBS) $(BACKENDLIBS) $(CFLAGS)
        $(RM) stamp-gnatlib2-rts stamp-tools
 
-gnatbind$(exeext): ada/b_gnatb.o $(CONFIG_H) $(GNATBIND_OBJS) libcommon-target.a $(LIBDEPS)
-       $(GCC_LINK) -o $@ ada/b_gnatb.o $(GNATBIND_OBJS) libcommon-target.a $(LIBS) $(SYSLIBS) $(CFLAGS)
+gnatbind$(exeext): ada/b_gnatb.o $(CONFIG_H) $(GNATBIND_OBJS) ggc-none.o libcommon-target.a $(LIBDEPS)
+       $(GCC_LINK) -o $@ ada/b_gnatb.o $(GNATBIND_OBJS) ggc-none.o libcommon-target.a $(LIBS) $(SYSLIBS) $(CFLAGS)
 
 # use cross-gcc
 gnat-cross: force
@@ -1237,7 +1237,8 @@ ada/trans.o : ada/gcc-interface/trans.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \
 
 ada/utils.o : ada/gcc-interface/utils.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \
    $(TM_H) $(TREE_H) $(FLAGS_H) toplev.h $(RTL_H) output.h debug.h convert.h \
-   $(TARGET_H) function.h langhooks.h $(CGRAPH_H) $(DIAGNOSTIC_H) \
+   $(TARGET_H) $(COMMON_TARGET_H) function.h langhooks.h \
+   $(CGRAPH_H) $(DIAGNOSTIC_H) \
    $(TREE_DUMP_H) $(TREE_INLINE_H) tree-iterator.h \
    ada/gcc-interface/ada.h ada/types.h ada/atree.h ada/elists.h ada/namet.h \
    ada/nlists.h ada/stringt.h ada/uintp.h ada/fe.h ada/sinfo.h ada/einfo.h \
index 0b58c1889f4fb7df0554745c65cd32ada9964049..3c998d47d3ad20872723a07ed84fc0a2819ba9ad 100644 (file)
@@ -180,7 +180,8 @@ LIBINTL_DEP = @LIBINTL_DEP@
 SYSLIBS = @GNAT_LIBEXC@
 
 # List of extra object files linked in with various programs.
-EXTRA_GNATTOOLS_OBJS = ../../libcommon-target.a ../../libcommon.a
+EXTRA_GNATTOOLS_OBJS = ../../libcommon-target.a ../../libcommon.a \
+       ../../../libcpp/libcpp.a
 
 # List extra gnattools
 EXTRA_GNATTOOLS =
index 0f2a331f809181f37d7fddceedf0c024f310c316..e7496321702646db4c6a528a3e4d01d1c065ce94 100644 (file)
@@ -36,6 +36,7 @@
 #include "debug.h"
 #include "convert.h"
 #include "target.h"
+#include "common/common-target.h"
 #include "langhooks.h"
 #include "cgraph.h"
 #include "diagnostic.h"
@@ -1720,7 +1721,7 @@ process_attributes (tree decl, struct attrib *attr_list)
        break;
 
       case ATTR_LINK_SECTION:
-       if (targetm.have_named_sections)
+       if (targetm_common.have_named_sections)
          {
            DECL_SECTION_NAME (decl)
              = build_string (IDENTIFIER_LENGTH (attr_list->name),
index 7a6e7fa5676b978dd6c60a5d4456e229579c82b5..f42c5c33571aa4c072f9c3475f4ffea570b6986d 100644 (file)
@@ -1,3 +1,11 @@
+2011-06-14  Joseph Myers  <joseph@codesourcery.com>
+
+       * c-common.c: Include common/common-target.h.
+       (handle_section_attribute): Use
+       targetm_common.have_named_sections.
+       * c-cppbuiltin.c: Include common/common-target.h.
+       (c_cpp_builtins): Use targetm_common.except_unwind_info.
+
 2011-06-10  Richard Guenther  <rguenther@suse.de>
 
        * c-pretty-print.c (pp_c_type_specifier): Use pp_c_identifier
index 37a5f1e45d447c854bc3156b00b46a376c2154b9..e5849efc2ae45d26c6916fe29913b7ecfaf73540 100644 (file)
@@ -35,6 +35,7 @@ along with GCC; see the file COPYING3.  If not see
 #include "obstack.h"
 #include "cpplib.h"
 #include "target.h"
+#include "common/common-target.h"
 #include "langhooks.h"
 #include "tree-inline.h"
 #include "toplev.h"
@@ -6563,7 +6564,7 @@ handle_section_attribute (tree *node, tree ARG_UNUSED (name), tree args,
 {
   tree decl = *node;
 
-  if (targetm.have_named_sections)
+  if (targetm_common.have_named_sections)
     {
       user_defined_section_attribute = true;
 
index bc75e02d28a7c49d30de2f264ca89704cfd3c25d..9f0918daed671473b9475cbc748ae912e7f38d98 100644 (file)
@@ -31,6 +31,7 @@ along with GCC; see the file COPYING3.  If not see
 #include "debug.h"             /* For dwarf2out_do_cfi_asm.  */
 #include "tm_p.h"              /* For TARGET_CPU_CPP_BUILTINS & friends.  */
 #include "target.h"
+#include "common/common-target.h"
 #include "cpp-id-data.h"
 #include "cppbuiltin.h"
 
@@ -626,7 +627,7 @@ c_cpp_builtins (cpp_reader *pfile)
                                   1000 + flag_abi_version);
 
   /* libgcc needs to know this.  */
-  if (targetm.except_unwind_info (&global_options) == UI_SJLJ)
+  if (targetm_common.except_unwind_info (&global_options) == UI_SJLJ)
     cpp_define (pfile, "__USING_SJLJ_EXCEPTIONS__");
 
   /* limits.h and stdint.h need to know these.  */
index 02709d09a3cbbaf84f06a193f7678ff4923d651f..d320fcc5dbd8a1fea9668934dd19e0c1187b8c98 100644 (file)
@@ -33,6 +33,7 @@ along with GCC; see the file COPYING3.  If not see
 #include "cfglayout.h"
 #include "cfgloop.h"
 #include "target.h"
+#include "common/common-target.h"
 #include "ggc.h"
 #include "alloc-pool.h"
 #include "flags.h"
@@ -912,7 +913,7 @@ fixup_reorder_chain (void)
             section boundaries).  */
          BB_COPY_PARTITION (src_bb, single_pred (bb));
          if (flag_reorder_blocks_and_partition
-             && targetm.have_named_sections
+             && targetm_common.have_named_sections
              && JUMP_P (BB_END (bb))
              && !any_condjump_p (BB_END (bb))
              && (EDGE_SUCC (bb, 0)->flags & EDGE_CROSSING))
index 482568c921ec9f778868eb061551b9df6aa8c478..7eb4362341b18436266d7278eb806dd1b9d6aed3 100644 (file)
@@ -1,6 +1,6 @@
 /* Control flow graph manipulation code for GNU compiler.
    Copyright (C) 1987, 1988, 1992, 1993, 1994, 1995, 1996, 1997, 1998,
-   1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010
+   1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011
    Free Software Foundation, Inc.
 
 This file is part of GCC.
@@ -59,6 +59,7 @@ along with GCC; see the file COPYING3.  If not see
 #include "cfglayout.h"
 #include "expr.h"
 #include "target.h"
+#include "common/common-target.h"
 #include "cfgloop.h"
 #include "ggc.h"
 #include "tree-pass.h"
@@ -1224,7 +1225,7 @@ force_nonfallthru_and_redirect (edge e, basic_block target)
 
       BB_COPY_PARTITION (jump_block, e->src);
       if (flag_reorder_blocks_and_partition
-         && targetm.have_named_sections
+         && targetm_common.have_named_sections
          && JUMP_P (BB_END (jump_block))
          && !any_condjump_p (BB_END (jump_block))
          && (EDGE_SUCC (jump_block, 0)->flags & EDGE_CROSSING))
@@ -1524,7 +1525,7 @@ commit_one_edge_insertion (edge e)
       after = BB_END (bb);
 
       if (flag_reorder_blocks_and_partition
-         && targetm.have_named_sections
+         && targetm_common.have_named_sections
          && e->src != ENTRY_BLOCK_PTR
          && BB_PARTITION (e->src) == BB_COLD_PARTITION
          && !(e->flags & EDGE_CROSSING)
index a0587082bd6d0c435d51ea8dc88b5456acbc4405..ea16beef5ea9d0f122897b3dc0fbb3e2df3d3a89 100644 (file)
    along with this program; see the file COPYING3.  If not see
    <http://www.gnu.org/licenses/>.  */
 
+#ifdef TARGET_ASM_NAMED_SECTION
+#define TARGET_HAVE_NAMED_SECTIONS true
+#endif
+
 #include "common/common-target-hooks-def.h"
 #include "hooks.h"
+#include "common/common-targhooks.h"
index 57fc5c4670946a3808a4773d9d1b33507893a553..ab89758221aec2a7c71f355f7adea7e1abbe0aaf 100644 (file)
@@ -28,6 +28,66 @@ HOOK_VECTOR (TARGETM_COMMON_INITIALIZER, gcc_targetm_common)
 #undef HOOK_PREFIX
 #define HOOK_PREFIX "TARGET_"
 
+/* Handle target switch DECODED for options structures OPTS and
+   OPTS_SET, at location LOC.  Return true if the switch was valid.  */
+DEFHOOK
+(handle_option,
+ "",
+ bool, (struct gcc_options *opts, struct gcc_options *opts_set,
+       const struct cl_decoded_option *decoded,
+       location_t loc),
+ default_target_handle_option)
+
+DEFHOOK
+(option_init_struct,
+"Set target-dependent initial values of fields in @var{opts}.",
+ void, (struct gcc_options *opts),
+ hook_void_gcc_optionsp)
+
+/* Set default optimizations for the target.  */
+DEFHOOKPOD
+(option_optimization_table,
+ "",
+ const struct default_options *, empty_optimization_table)
+
+/* The initial value of target_flags.  */
+DEFHOOKPOD
+(default_target_flags,
+ "",
+ int, 0)
+
+/* Determine the type of unwind info to emit for exceptions.  */
+DEFHOOK
+(except_unwind_info,
+ "",
+ enum unwind_info_type, (struct gcc_options *opts),
+ default_except_unwind_info)
+
+DEFHOOK
+(supports_split_stack,
+ "Whether this target supports splitting the stack when the options\
+ described in @var{opts} have been passed.  This is called\
+ after options have been parsed, so the target may reject splitting\
+ the stack in some configurations.  The default version of this hook\
+ returns false.  If @var{report} is true, this function may issue a warning\
+ or error; if @var{report} is false, it must simply return a value",
+ bool, (bool report, struct gcc_options *opts),
+ hook_bool_bool_gcc_optionsp_false)
+
+/* Leave the boolean fields at the end.  */
+
+/* True if unwinding tables should be generated by default.  */
+DEFHOOKPOD
+(unwind_tables_default,
+ "",
+ bool, false)
+
+/* True if arbitrary sections are supported.  */
+DEFHOOKPOD
+(have_named_sections,
+ "",
+ bool, false)
+
 DEFHOOKPOD
 (always_strip_dotdot,
  "True if @file{..} components should always be removed from directory names\
@@ -37,3 +97,5 @@ DEFHOOKPOD
  bool, false)
  
 HOOK_VECTOR_END (C90_EMPTY_HACK)
+
+#undef HOOK_PREFIX
index 615ac084a0f2bb81dd8a9443305f39a2e16403ce..cd2d47c38bbf8d084c243a4fefa46d8751beb935 100644 (file)
@@ -1,5 +1,5 @@
 /* Data structure definitions for common hooks.
-   Copyright (C) 2011
+   Copyright (C) 2010, 2011
    Free Software Foundation, Inc.
 
    This program is free software; you can redistribute it and/or modify it
 #ifndef GCC_COMMON_TARGET_H
 #define GCC_COMMON_TARGET_H
 
+#include "input.h"
+
+/* Sets of optimization levels at which an option may be enabled by
+   default_options_optimization.  */
+enum opt_levels
+{
+  OPT_LEVELS_NONE, /* No levels (mark end of array).  */
+  OPT_LEVELS_ALL, /* All levels (used by targets to disable options
+                    enabled in target-independent code).  */
+  OPT_LEVELS_0_ONLY, /* -O0 only.  */
+  OPT_LEVELS_1_PLUS, /* -O1 and above, including -Os.  */
+  OPT_LEVELS_1_PLUS_SPEED_ONLY, /* -O1 and above, but not -Os.  */
+  OPT_LEVELS_2_PLUS, /* -O2 and above, including -Os.  */
+  OPT_LEVELS_2_PLUS_SPEED_ONLY, /* -O2 and above, but not -Os.  */
+  OPT_LEVELS_3_PLUS, /* -O3 and above.  */
+  OPT_LEVELS_3_PLUS_AND_SIZE, /* -O3 and above and -Os.  */
+  OPT_LEVELS_SIZE, /* -Os only.  */
+  OPT_LEVELS_FAST /* -Ofast only.  */
+};
+
+/* Description of options to enable by default at given levels.  */
+struct default_options
+{
+  /* The levels at which to enable the option.  */
+  enum opt_levels levels;
+
+  /* The option index and argument or enabled/disabled sense of the
+     option, as passed to handle_generated_option.  If ARG is NULL and
+     the option allows a negative form, the option is considered to be
+     passed in negative form when the optimization level is not one of
+     those in LEVELS (in order to handle changes to the optimization
+     level with the "optimize" attribute).  */
+  size_t opt_index;
+  const char *arg;
+  int value;
+};
+
 #define DEFHOOKPOD(NAME, DOC, TYPE, INIT) TYPE NAME;
 #define DEFHOOK(NAME, DOC, TYPE, PARAMS, INIT) TYPE (* NAME) PARAMS;
 #define DEFHOOK_UNDOC DEFHOOK
diff --git a/gcc/common/common-targhooks.c b/gcc/common/common-targhooks.c
new file mode 100644 (file)
index 0000000..d959cf9
--- /dev/null
@@ -0,0 +1,85 @@
+/* Default common target hook functions.
+   Copyright (C) 2003, 2004, 2005, 2007, 2008, 2009, 2010, 2011
+   Free Software Foundation, Inc.
+
+This file is part of GCC.
+
+GCC is free software; you can redistribute it and/or modify it under
+the terms of the GNU General Public License as published by the Free
+Software Foundation; either version 3, or (at your option) any later
+version.
+
+GCC is distributed in the hope that it will be useful, but WITHOUT ANY
+WARRANTY; without even the implied warranty of MERCHANTABILITY or
+FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+for more details.
+
+You should have received a copy of the GNU General Public License
+along with GCC; see the file COPYING3.  If not see
+<http://www.gnu.org/licenses/>.  */
+
+#include "config.h"
+#include "system.h"
+#include "coretypes.h"
+#include "input.h"
+#include "tm.h"
+#include "common/common-target.h"
+#include "common/common-targhooks.h"
+
+/* Determine the exception handling mechanism for the target.  */
+
+enum unwind_info_type
+default_except_unwind_info (struct gcc_options *opts ATTRIBUTE_UNUSED)
+{
+  /* Obey the configure switch to turn on sjlj exceptions.  */
+#ifdef CONFIG_SJLJ_EXCEPTIONS
+  if (CONFIG_SJLJ_EXCEPTIONS)
+    return UI_SJLJ;
+#endif
+
+  /* ??? Change all users to the hook, then poison this.  */
+#ifdef DWARF2_UNWIND_INFO
+  if (DWARF2_UNWIND_INFO)
+    return UI_DWARF2;
+#endif
+
+  return UI_SJLJ;
+}
+
+/* To be used by targets that force dwarf2 unwind enabled.  */
+
+enum unwind_info_type
+dwarf2_except_unwind_info (struct gcc_options *opts ATTRIBUTE_UNUSED)
+{
+  /* Obey the configure switch to turn on sjlj exceptions.  */
+#ifdef CONFIG_SJLJ_EXCEPTIONS
+  if (CONFIG_SJLJ_EXCEPTIONS)
+    return UI_SJLJ;
+#endif
+
+  return UI_DWARF2;
+}
+
+/* To be used by targets that force sjlj unwind enabled.  */
+
+enum unwind_info_type
+sjlj_except_unwind_info (struct gcc_options *opts ATTRIBUTE_UNUSED)
+{
+  return UI_SJLJ;
+}
+
+/* Default version of TARGET_HANDLE_OPTION.  */
+
+bool
+default_target_handle_option (struct gcc_options *opts ATTRIBUTE_UNUSED,
+                             struct gcc_options *opts_set ATTRIBUTE_UNUSED,
+                             const struct cl_decoded_option *decoded ATTRIBUTE_UNUSED,
+                             location_t loc ATTRIBUTE_UNUSED)
+{
+  return true;
+}
+
+const struct default_options empty_optimization_table[] =
+  {
+    { OPT_LEVELS_NONE, 0, NULL, 0 }
+  };
diff --git a/gcc/common/common-targhooks.h b/gcc/common/common-targhooks.h
new file mode 100644 (file)
index 0000000..dab70de
--- /dev/null
@@ -0,0 +1,35 @@
+/* Default common target hook functions.
+   Copyright (C) 2003, 2004, 2005, 2007, 2008, 2009, 2010, 2011
+   Free Software Foundation, Inc.
+
+This file is part of GCC.
+
+GCC is free software; you can redistribute it and/or modify it under
+the terms of the GNU General Public License as published by the Free
+Software Foundation; either version 3, or (at your option) any later
+version.
+
+GCC is distributed in the hope that it will be useful, but WITHOUT ANY
+WARRANTY; without even the implied warranty of MERCHANTABILITY or
+FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+for more details.
+
+You should have received a copy of the GNU General Public License
+along with GCC; see the file COPYING3.  If not see
+<http://www.gnu.org/licenses/>.  */
+
+#ifndef GCC_COMMON_TARGHOOKS_H
+#define GCC_COMMON_TARGHOOKS_H
+
+extern enum unwind_info_type default_except_unwind_info (struct gcc_options *);
+extern enum unwind_info_type dwarf2_except_unwind_info (struct gcc_options *);
+extern enum unwind_info_type sjlj_except_unwind_info (struct gcc_options *);
+
+extern bool default_target_handle_option (struct gcc_options *,
+                                         struct gcc_options *,
+                                         const struct cl_decoded_option *,
+                                         location_t);
+
+extern const struct default_options empty_optimization_table[];
+
+#endif
diff --git a/gcc/common/config/alpha/alpha-common.c b/gcc/common/config/alpha/alpha-common.c
new file mode 100644 (file)
index 0000000..fcf5369
--- /dev/null
@@ -0,0 +1,81 @@
+/* Common hooks for DEC Alpha.
+   Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001,
+   2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011
+   Free Software Foundation, Inc.
+
+This file is part of GCC.
+
+GCC is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 3, or (at your option)
+any later version.
+
+GCC is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GCC; see the file COPYING3.  If not see
+<http://www.gnu.org/licenses/>.  */
+
+#include "config.h"
+#include "system.h"
+#include "coretypes.h"
+#include "diagnostic-core.h"
+#include "tm.h"
+#include "common/common-target.h"
+#include "common/common-target-def.h"
+#include "opts.h"
+#include "flags.h"
+
+/* Implement TARGET_OPTION_OPTIMIZATION_TABLE.  */
+static const struct default_options alpha_option_optimization_table[] =
+  {
+    { OPT_LEVELS_1_PLUS, OPT_fomit_frame_pointer, NULL, 1 },
+    { OPT_LEVELS_NONE, 0, NULL, 0 }
+  };
+
+/* Implement TARGET_HANDLE_OPTION.  */
+
+static bool
+alpha_handle_option (struct gcc_options *opts,
+                    struct gcc_options *opts_set ATTRIBUTE_UNUSED,
+                    const struct cl_decoded_option *decoded,
+                    location_t loc)
+{
+  size_t code = decoded->opt_index;
+  const char *arg = decoded->arg;
+  int value = decoded->value;
+
+  switch (code)
+    {
+    case OPT_mfp_regs:
+      if (value == 0)
+       opts->x_target_flags |= MASK_SOFT_FP;
+      break;
+
+    case OPT_mieee:
+    case OPT_mieee_with_inexact:
+      opts->x_target_flags |= MASK_IEEE_CONFORMANT;
+      break;
+
+    case OPT_mtls_size_:
+      if (value != 16 && value != 32 && value != 64)
+       error_at (loc, "bad value %qs for -mtls-size switch", arg);
+      break;
+    }
+
+  return true;
+}
+
+#undef TARGET_DEFAULT_TARGET_FLAGS
+#define TARGET_DEFAULT_TARGET_FLAGS \
+  (TARGET_DEFAULT | TARGET_CPU_DEFAULT | TARGET_DEFAULT_EXPLICIT_RELOCS)
+#undef TARGET_HANDLE_OPTION
+#define TARGET_HANDLE_OPTION alpha_handle_option
+
+#undef TARGET_OPTION_OPTIMIZATION_TABLE
+#define TARGET_OPTION_OPTIMIZATION_TABLE alpha_option_optimization_table
+
+struct gcc_targetm_common targetm_common = TARGETM_COMMON_INITIALIZER;
diff --git a/gcc/common/config/arm/arm-common.c b/gcc/common/config/arm/arm-common.c
new file mode 100644 (file)
index 0000000..b8348bf
--- /dev/null
@@ -0,0 +1,76 @@
+/* Common hooks for ARM.
+   Copyright (C) 1991, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001,
+   2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011
+   Free Software Foundation, Inc.
+
+   This file is part of GCC.
+
+   GCC is free software; you can redistribute it and/or modify it
+   under the terms of the GNU General Public License as published
+   by the Free Software Foundation; either version 3, or (at your
+   option) any later version.
+
+   GCC is distributed in the hope that it will be useful, but WITHOUT
+   ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+   or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public
+   License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with GCC; see the file COPYING3.  If not see
+   <http://www.gnu.org/licenses/>.  */
+
+#include "config.h"
+#include "system.h"
+#include "coretypes.h"
+#include "tm.h"
+#include "tm_p.h"
+#include "common/common-target.h"
+#include "common/common-target-def.h"
+#include "opts.h"
+#include "flags.h"
+
+/* Set default optimization options.  */
+static const struct default_options arm_option_optimization_table[] =
+  {
+    /* Enable section anchors by default at -O1 or higher.  */
+    { OPT_LEVELS_1_PLUS, OPT_fsection_anchors, NULL, 1 },
+    { OPT_LEVELS_1_PLUS, OPT_fomit_frame_pointer, NULL, 1 },
+    { OPT_LEVELS_NONE, 0, NULL, 0 }
+  };
+
+/* Implement TARGET_EXCEPT_UNWIND_INFO.  */
+
+enum unwind_info_type
+arm_except_unwind_info (struct gcc_options *opts)
+{
+  /* Honor the --enable-sjlj-exceptions configure switch.  */
+#ifdef CONFIG_SJLJ_EXCEPTIONS
+  if (CONFIG_SJLJ_EXCEPTIONS)
+    return UI_SJLJ;
+#endif
+
+  /* If not using ARM EABI unwind tables... */
+  if (ARM_UNWIND_INFO)
+    {
+      /* For simplicity elsewhere in this file, indicate that all unwind
+        info is disabled if we're not emitting unwind tables.  */
+      if (!opts->x_flag_exceptions && !opts->x_flag_unwind_tables)
+       return UI_NONE;
+      else
+       return UI_TARGET;
+    }
+
+  /* ... we use sjlj exceptions for backwards compatibility.  */
+  return UI_SJLJ;
+}
+
+#undef  TARGET_DEFAULT_TARGET_FLAGS
+#define TARGET_DEFAULT_TARGET_FLAGS (TARGET_DEFAULT | MASK_SCHED_PROLOG)
+
+#undef  TARGET_OPTION_OPTIMIZATION_TABLE
+#define TARGET_OPTION_OPTIMIZATION_TABLE arm_option_optimization_table
+
+#undef TARGET_EXCEPT_UNWIND_INFO
+#define TARGET_EXCEPT_UNWIND_INFO  arm_except_unwind_info
+
+struct gcc_targetm_common targetm_common = TARGETM_COMMON_INITIALIZER;
diff --git a/gcc/common/config/avr/avr-common.c b/gcc/common/config/avr/avr-common.c
new file mode 100644 (file)
index 0000000..0ede117
--- /dev/null
@@ -0,0 +1,41 @@
+/* Common hooks for ATMEL AVR.
+   Copyright (C) 1998, 1999, 2000, 2001, 2002, 2004, 2005, 2006, 2007, 2008,
+   2009, 2010, 2011 Free Software Foundation, Inc.
+
+   This file is part of GCC.
+
+   GCC is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3, or (at your option)
+   any later version.
+   
+   GCC is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+   
+   You should have received a copy of the GNU General Public License
+   along with GCC; see the file COPYING3.  If not see
+   <http://www.gnu.org/licenses/>.  */
+
+#include "config.h"
+#include "system.h"
+#include "coretypes.h"
+#include "tm.h"
+#include "common/common-target.h"
+#include "common/common-target-def.h"
+
+/* Implement TARGET_OPTION_OPTIMIZATION_TABLE.  */
+static const struct default_options avr_option_optimization_table[] =
+  {
+    { OPT_LEVELS_1_PLUS, OPT_fomit_frame_pointer, NULL, 1 },
+    { OPT_LEVELS_NONE, 0, NULL, 0 }
+  };
+
+#undef TARGET_OPTION_OPTIMIZATION_TABLE
+#define TARGET_OPTION_OPTIMIZATION_TABLE avr_option_optimization_table
+
+#undef TARGET_EXCEPT_UNWIND_INFO
+#define TARGET_EXCEPT_UNWIND_INFO sjlj_except_unwind_info
+
+struct gcc_targetm_common targetm_common = TARGETM_COMMON_INITIALIZER;
diff --git a/gcc/common/config/bfin/bfin-common.c b/gcc/common/config/bfin/bfin-common.c
new file mode 100644 (file)
index 0000000..715a1ae
--- /dev/null
@@ -0,0 +1,390 @@
+/* Common hooks for Blackfin.
+   Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2011
+   Free Software Foundation, Inc.
+
+   This file is part of GCC.
+
+   GCC is free software; you can redistribute it and/or modify it
+   under the terms of the GNU General Public License as published
+   by the Free Software Foundation; either version 3, or (at your
+   option) any later version.
+
+   GCC is distributed in the hope that it will be useful, but WITHOUT
+   ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+   or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public
+   License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with GCC; see the file COPYING3.  If not see
+   <http://www.gnu.org/licenses/>.  */
+
+#include "config.h"
+#include "system.h"
+#include "coretypes.h"
+#include "diagnostic-core.h"
+#include "tm.h"
+#include "machmode.h"
+#include "tm_p.h"
+#include "common/common-target.h"
+#include "common/common-target-def.h"
+#include "opts.h"
+#include "flags.h"
+
+EXPORTED_CONST struct bfin_cpu bfin_cpus[] =
+{
+
+  {"bf512", BFIN_CPU_BF512, 0x0002,
+   WA_SPECULATIVE_LOADS | WA_05000074},
+  {"bf512", BFIN_CPU_BF512, 0x0001,
+   WA_SPECULATIVE_LOADS | WA_05000074},
+  {"bf512", BFIN_CPU_BF512, 0x0000,
+   WA_SPECULATIVE_LOADS | WA_05000074},
+
+  {"bf514", BFIN_CPU_BF514, 0x0002,
+   WA_SPECULATIVE_LOADS | WA_05000074},
+  {"bf514", BFIN_CPU_BF514, 0x0001,
+   WA_SPECULATIVE_LOADS | WA_05000074},
+  {"bf514", BFIN_CPU_BF514, 0x0000,
+   WA_SPECULATIVE_LOADS | WA_05000074},
+
+  {"bf516", BFIN_CPU_BF516, 0x0002,
+   WA_SPECULATIVE_LOADS | WA_05000074},
+  {"bf516", BFIN_CPU_BF516, 0x0001,
+   WA_SPECULATIVE_LOADS | WA_05000074},
+  {"bf516", BFIN_CPU_BF516, 0x0000,
+   WA_SPECULATIVE_LOADS | WA_05000074},
+
+  {"bf518", BFIN_CPU_BF518, 0x0002,
+   WA_SPECULATIVE_LOADS | WA_05000074},
+  {"bf518", BFIN_CPU_BF518, 0x0001,
+   WA_SPECULATIVE_LOADS | WA_05000074},
+  {"bf518", BFIN_CPU_BF518, 0x0000,
+   WA_SPECULATIVE_LOADS | WA_05000074},
+
+  {"bf522", BFIN_CPU_BF522, 0x0002,
+   WA_SPECULATIVE_LOADS | WA_05000074},
+  {"bf522", BFIN_CPU_BF522, 0x0001,
+   WA_SPECULATIVE_LOADS | WA_RETS | WA_05000074},
+  {"bf522", BFIN_CPU_BF522, 0x0000,
+   WA_SPECULATIVE_LOADS | WA_RETS | WA_05000074},
+
+  {"bf523", BFIN_CPU_BF523, 0x0002,
+   WA_SPECULATIVE_LOADS | WA_05000074},
+  {"bf523", BFIN_CPU_BF523, 0x0001,
+   WA_SPECULATIVE_LOADS | WA_RETS | WA_05000074},
+  {"bf523", BFIN_CPU_BF523, 0x0000,
+   WA_SPECULATIVE_LOADS | WA_RETS | WA_05000074},
+
+  {"bf524", BFIN_CPU_BF524, 0x0002,
+   WA_SPECULATIVE_LOADS | WA_05000074},
+  {"bf524", BFIN_CPU_BF524, 0x0001,
+   WA_SPECULATIVE_LOADS | WA_RETS | WA_05000074},
+  {"bf524", BFIN_CPU_BF524, 0x0000,
+   WA_SPECULATIVE_LOADS | WA_RETS | WA_05000074},
+
+  {"bf525", BFIN_CPU_BF525, 0x0002,
+   WA_SPECULATIVE_LOADS | WA_05000074},
+  {"bf525", BFIN_CPU_BF525, 0x0001,
+   WA_SPECULATIVE_LOADS | WA_RETS | WA_05000074},
+  {"bf525", BFIN_CPU_BF525, 0x0000,
+   WA_SPECULATIVE_LOADS | WA_RETS | WA_05000074},
+
+  {"bf526", BFIN_CPU_BF526, 0x0002,
+   WA_SPECULATIVE_LOADS | WA_05000074},
+  {"bf526", BFIN_CPU_BF526, 0x0001,
+   WA_SPECULATIVE_LOADS | WA_RETS | WA_05000074},
+  {"bf526", BFIN_CPU_BF526, 0x0000,
+   WA_SPECULATIVE_LOADS | WA_RETS | WA_05000074},
+
+  {"bf527", BFIN_CPU_BF527, 0x0002,
+   WA_SPECULATIVE_LOADS | WA_05000074},
+  {"bf527", BFIN_CPU_BF527, 0x0001,
+   WA_SPECULATIVE_LOADS | WA_RETS | WA_05000074},
+  {"bf527", BFIN_CPU_BF527, 0x0000,
+   WA_SPECULATIVE_LOADS | WA_RETS | WA_05000074},
+
+  {"bf531", BFIN_CPU_BF531, 0x0006,
+   WA_SPECULATIVE_LOADS | WA_LOAD_LCREGS | WA_05000074},
+  {"bf531", BFIN_CPU_BF531, 0x0005,
+   WA_SPECULATIVE_LOADS | WA_RETS | WA_05000283 | WA_05000315
+   | WA_LOAD_LCREGS | WA_05000074},
+  {"bf531", BFIN_CPU_BF531, 0x0004,
+   WA_SPECULATIVE_LOADS | WA_SPECULATIVE_SYNCS | WA_RETS
+   | WA_05000283 | WA_05000257 | WA_05000315 | WA_LOAD_LCREGS
+   | WA_05000074},
+  {"bf531", BFIN_CPU_BF531, 0x0003,
+   WA_SPECULATIVE_LOADS | WA_SPECULATIVE_SYNCS | WA_RETS
+   | WA_05000283 | WA_05000257 | WA_05000315 | WA_LOAD_LCREGS
+   | WA_05000074},
+
+  {"bf532", BFIN_CPU_BF532, 0x0006,
+   WA_SPECULATIVE_LOADS | WA_LOAD_LCREGS | WA_05000074},
+  {"bf532", BFIN_CPU_BF532, 0x0005,
+   WA_SPECULATIVE_LOADS | WA_RETS | WA_05000283 | WA_05000315
+   | WA_LOAD_LCREGS | WA_05000074},
+  {"bf532", BFIN_CPU_BF532, 0x0004,
+   WA_SPECULATIVE_LOADS | WA_SPECULATIVE_SYNCS | WA_RETS
+   | WA_05000283 | WA_05000257 | WA_05000315 | WA_LOAD_LCREGS
+   | WA_05000074},
+  {"bf532", BFIN_CPU_BF532, 0x0003,
+   WA_SPECULATIVE_LOADS | WA_SPECULATIVE_SYNCS | WA_RETS
+   | WA_05000283 | WA_05000257 | WA_05000315 | WA_LOAD_LCREGS
+   | WA_05000074},
+
+  {"bf533", BFIN_CPU_BF533, 0x0006,
+   WA_SPECULATIVE_LOADS | WA_LOAD_LCREGS | WA_05000074},
+  {"bf533", BFIN_CPU_BF533, 0x0005,
+   WA_SPECULATIVE_LOADS | WA_RETS | WA_05000283 | WA_05000315
+   | WA_LOAD_LCREGS | WA_05000074},
+  {"bf533", BFIN_CPU_BF533, 0x0004,
+   WA_SPECULATIVE_LOADS | WA_SPECULATIVE_SYNCS | WA_RETS
+   | WA_05000283 | WA_05000257 | WA_05000315 | WA_LOAD_LCREGS
+   | WA_05000074},
+  {"bf533", BFIN_CPU_BF533, 0x0003,
+   WA_SPECULATIVE_LOADS | WA_SPECULATIVE_SYNCS | WA_RETS
+   | WA_05000283 | WA_05000257 | WA_05000315 | WA_LOAD_LCREGS
+   | WA_05000074},
+
+  {"bf534", BFIN_CPU_BF534, 0x0003,
+   WA_SPECULATIVE_LOADS | WA_RETS | WA_LOAD_LCREGS | WA_05000074},
+  {"bf534", BFIN_CPU_BF534, 0x0002,
+   WA_SPECULATIVE_LOADS | WA_SPECULATIVE_SYNCS | WA_RETS
+   | WA_05000283 | WA_05000257 | WA_05000315 | WA_LOAD_LCREGS
+   | WA_05000074},
+  {"bf534", BFIN_CPU_BF534, 0x0001,
+   WA_SPECULATIVE_LOADS | WA_SPECULATIVE_SYNCS | WA_RETS
+   | WA_05000283 | WA_05000257 | WA_05000315 | WA_LOAD_LCREGS
+   | WA_05000074},
+
+  {"bf536", BFIN_CPU_BF536, 0x0003,
+   WA_SPECULATIVE_LOADS | WA_RETS | WA_LOAD_LCREGS | WA_05000074},
+  {"bf536", BFIN_CPU_BF536, 0x0002,
+   WA_SPECULATIVE_LOADS | WA_SPECULATIVE_SYNCS | WA_RETS
+   | WA_05000283 | WA_05000257 | WA_05000315 | WA_LOAD_LCREGS
+   | WA_05000074},
+  {"bf536", BFIN_CPU_BF536, 0x0001,
+   WA_SPECULATIVE_LOADS | WA_SPECULATIVE_SYNCS | WA_RETS
+   | WA_05000283 | WA_05000257 | WA_05000315 | WA_LOAD_LCREGS
+   | WA_05000074},
+
+  {"bf537", BFIN_CPU_BF537, 0x0003,
+   WA_SPECULATIVE_LOADS | WA_RETS | WA_LOAD_LCREGS | WA_05000074},
+  {"bf537", BFIN_CPU_BF537, 0x0002,
+   WA_SPECULATIVE_LOADS | WA_SPECULATIVE_SYNCS | WA_RETS
+   | WA_05000283 | WA_05000257 | WA_05000315 | WA_LOAD_LCREGS
+   | WA_05000074},
+  {"bf537", BFIN_CPU_BF537, 0x0001,
+   WA_SPECULATIVE_LOADS | WA_SPECULATIVE_SYNCS | WA_RETS
+   | WA_05000283 | WA_05000257 | WA_05000315 | WA_LOAD_LCREGS
+   | WA_05000074},
+
+  {"bf538", BFIN_CPU_BF538, 0x0005,
+   WA_SPECULATIVE_LOADS | WA_LOAD_LCREGS | WA_05000074},
+  {"bf538", BFIN_CPU_BF538, 0x0004,
+   WA_SPECULATIVE_LOADS | WA_RETS | WA_LOAD_LCREGS | WA_05000074},
+  {"bf538", BFIN_CPU_BF538, 0x0003,
+   WA_SPECULATIVE_LOADS | WA_RETS
+   | WA_05000283 | WA_05000315 | WA_LOAD_LCREGS | WA_05000074},
+  {"bf538", BFIN_CPU_BF538, 0x0002,
+   WA_SPECULATIVE_LOADS | WA_RETS
+   | WA_05000283 | WA_05000257 | WA_05000315 | WA_LOAD_LCREGS
+   | WA_05000074},
+
+  {"bf539", BFIN_CPU_BF539, 0x0005,
+   WA_SPECULATIVE_LOADS | WA_LOAD_LCREGS | WA_05000074},
+  {"bf539", BFIN_CPU_BF539, 0x0004,
+   WA_SPECULATIVE_LOADS | WA_RETS | WA_LOAD_LCREGS | WA_05000074},
+  {"bf539", BFIN_CPU_BF539, 0x0003,
+   WA_SPECULATIVE_LOADS | WA_RETS
+   | WA_05000283 | WA_05000315 | WA_LOAD_LCREGS | WA_05000074},
+  {"bf539", BFIN_CPU_BF539, 0x0002,
+   WA_SPECULATIVE_LOADS | WA_RETS
+   | WA_05000283 | WA_05000257 | WA_05000315 | WA_LOAD_LCREGS
+   | WA_05000074},
+
+  {"bf542m", BFIN_CPU_BF542M, 0x0003,
+   WA_SPECULATIVE_LOADS | WA_INDIRECT_CALLS | WA_05000074},
+
+  {"bf542", BFIN_CPU_BF542, 0x0004,
+   WA_SPECULATIVE_LOADS | WA_INDIRECT_CALLS | WA_05000074},
+  {"bf542", BFIN_CPU_BF542, 0x0002,
+   WA_SPECULATIVE_LOADS | WA_INDIRECT_CALLS | WA_05000074},
+  {"bf542", BFIN_CPU_BF542, 0x0001,
+   WA_SPECULATIVE_LOADS | WA_RETS | WA_INDIRECT_CALLS | WA_05000074},
+  {"bf542", BFIN_CPU_BF542, 0x0000,
+   WA_SPECULATIVE_LOADS | WA_RETS | WA_INDIRECT_CALLS | WA_LOAD_LCREGS
+   | WA_05000074},
+
+  {"bf544m", BFIN_CPU_BF544M, 0x0003,
+   WA_SPECULATIVE_LOADS | WA_INDIRECT_CALLS | WA_05000074},
+
+  {"bf544", BFIN_CPU_BF544, 0x0004,
+   WA_SPECULATIVE_LOADS | WA_INDIRECT_CALLS | WA_05000074},
+  {"bf544", BFIN_CPU_BF544, 0x0002,
+   WA_SPECULATIVE_LOADS | WA_INDIRECT_CALLS | WA_05000074},
+  {"bf544", BFIN_CPU_BF544, 0x0001,
+   WA_SPECULATIVE_LOADS | WA_RETS | WA_INDIRECT_CALLS | WA_05000074},
+  {"bf544", BFIN_CPU_BF544, 0x0000,
+   WA_SPECULATIVE_LOADS | WA_RETS | WA_INDIRECT_CALLS | WA_LOAD_LCREGS
+   | WA_05000074},
+
+  {"bf547m", BFIN_CPU_BF547M, 0x0003,
+   WA_SPECULATIVE_LOADS | WA_INDIRECT_CALLS | WA_05000074},
+
+  {"bf547", BFIN_CPU_BF547, 0x0004,
+   WA_SPECULATIVE_LOADS | WA_INDIRECT_CALLS | WA_05000074},
+  {"bf547", BFIN_CPU_BF547, 0x0002,
+   WA_SPECULATIVE_LOADS | WA_INDIRECT_CALLS | WA_05000074},
+  {"bf547", BFIN_CPU_BF547, 0x0001,
+   WA_SPECULATIVE_LOADS | WA_RETS | WA_INDIRECT_CALLS | WA_05000074},
+  {"bf547", BFIN_CPU_BF547, 0x0000,
+   WA_SPECULATIVE_LOADS | WA_RETS | WA_INDIRECT_CALLS | WA_LOAD_LCREGS
+   | WA_05000074},
+
+  {"bf548m", BFIN_CPU_BF548M, 0x0003,
+   WA_SPECULATIVE_LOADS | WA_INDIRECT_CALLS | WA_05000074},
+
+  {"bf548", BFIN_CPU_BF548, 0x0004,
+   WA_SPECULATIVE_LOADS | WA_INDIRECT_CALLS | WA_05000074},
+  {"bf548", BFIN_CPU_BF548, 0x0002,
+   WA_SPECULATIVE_LOADS | WA_INDIRECT_CALLS | WA_05000074},
+  {"bf548", BFIN_CPU_BF548, 0x0001,
+   WA_SPECULATIVE_LOADS | WA_RETS | WA_INDIRECT_CALLS | WA_05000074},
+  {"bf548", BFIN_CPU_BF548, 0x0000,
+   WA_SPECULATIVE_LOADS | WA_RETS | WA_INDIRECT_CALLS | WA_LOAD_LCREGS
+   | WA_05000074},
+
+  {"bf549m", BFIN_CPU_BF549M, 0x0003,
+   WA_SPECULATIVE_LOADS | WA_INDIRECT_CALLS | WA_05000074},
+
+  {"bf549", BFIN_CPU_BF549, 0x0004,
+   WA_SPECULATIVE_LOADS | WA_INDIRECT_CALLS | WA_05000074},
+  {"bf549", BFIN_CPU_BF549, 0x0002,
+   WA_SPECULATIVE_LOADS | WA_INDIRECT_CALLS | WA_05000074},
+  {"bf549", BFIN_CPU_BF549, 0x0001,
+   WA_SPECULATIVE_LOADS | WA_RETS | WA_INDIRECT_CALLS | WA_05000074},
+  {"bf549", BFIN_CPU_BF549, 0x0000,
+   WA_SPECULATIVE_LOADS | WA_RETS | WA_INDIRECT_CALLS | WA_LOAD_LCREGS
+   | WA_05000074},
+
+  {"bf561", BFIN_CPU_BF561, 0x0005, WA_RETS
+   | WA_05000283 | WA_05000315 | WA_LOAD_LCREGS | WA_05000074},
+  {"bf561", BFIN_CPU_BF561, 0x0003,
+   WA_SPECULATIVE_LOADS | WA_SPECULATIVE_SYNCS | WA_RETS
+   | WA_05000283 | WA_05000257 | WA_05000315 | WA_LOAD_LCREGS
+   | WA_05000074},
+  {"bf561", BFIN_CPU_BF561, 0x0002,
+   WA_SPECULATIVE_LOADS | WA_SPECULATIVE_SYNCS | WA_RETS
+   | WA_05000283 | WA_05000257 | WA_05000315 | WA_LOAD_LCREGS
+   | WA_05000074},
+
+  {"bf592", BFIN_CPU_BF592, 0x0001,
+   WA_SPECULATIVE_LOADS | WA_05000074},
+  {"bf592", BFIN_CPU_BF592, 0x0000,
+   WA_SPECULATIVE_LOADS | WA_05000074},
+
+  {NULL, BFIN_CPU_UNKNOWN, 0, 0}
+};
+
+/* Implement TARGET_HANDLE_OPTION.  */
+
+static bool
+bfin_handle_option (struct gcc_options *opts,
+                   struct gcc_options *opts_set ATTRIBUTE_UNUSED,
+                   const struct cl_decoded_option *decoded,
+                   location_t loc)
+{
+  size_t code = decoded->opt_index;
+  const char *arg = decoded->arg;
+  int value = decoded->value;
+
+  switch (code)
+    {
+    case OPT_mshared_library_id_:
+      if (value > MAX_LIBRARY_ID)
+       error_at (loc, "-mshared-library-id=%s is not between 0 and %d",
+                 arg, MAX_LIBRARY_ID);
+      return true;
+
+    case OPT_mcpu_:
+      {
+       const char *p, *q;
+       int i;
+
+       i = 0;
+       while ((p = bfin_cpus[i].name) != NULL)
+         {
+           if (strncmp (arg, p, strlen (p)) == 0)
+             break;
+           i++;
+         }
+
+       if (p == NULL)
+         {
+           error_at (loc, "-mcpu=%s is not valid", arg);
+           return false;
+         }
+
+       opts->x_bfin_cpu_type = bfin_cpus[i].type;
+
+       q = arg + strlen (p);
+
+       if (*q == '\0')
+         {
+           opts->x_bfin_si_revision = bfin_cpus[i].si_revision;
+           opts->x_bfin_workarounds |= bfin_cpus[i].workarounds;
+         }
+       else if (strcmp (q, "-none") == 0)
+         opts->x_bfin_si_revision = -1;
+       else if (strcmp (q, "-any") == 0)
+         {
+           opts->x_bfin_si_revision = 0xffff;
+           while (bfin_cpus[i].type == opts->x_bfin_cpu_type)
+             {
+               opts->x_bfin_workarounds |= bfin_cpus[i].workarounds;
+               i++;
+             }
+         }
+       else
+         {
+           unsigned int si_major, si_minor;
+           int rev_len, n;
+
+           rev_len = strlen (q);
+
+           if (sscanf (q, "-%u.%u%n", &si_major, &si_minor, &n) != 2
+               || n != rev_len
+               || si_major > 0xff || si_minor > 0xff)
+             {
+             invalid_silicon_revision:
+               error_at (loc, "-mcpu=%s has invalid silicon revision", arg);
+               return false;
+             }
+
+           opts->x_bfin_si_revision = (si_major << 8) | si_minor;
+
+           while (bfin_cpus[i].type == opts->x_bfin_cpu_type
+                  && bfin_cpus[i].si_revision != opts->x_bfin_si_revision)
+             i++;
+
+           if (bfin_cpus[i].type != opts->x_bfin_cpu_type)
+             goto invalid_silicon_revision;
+
+           opts->x_bfin_workarounds |= bfin_cpus[i].workarounds;
+         }
+
+       return true;
+      }
+
+    default:
+      return true;
+    }
+}
+
+#undef TARGET_HANDLE_OPTION
+#define TARGET_HANDLE_OPTION bfin_handle_option
+
+#undef TARGET_DEFAULT_TARGET_FLAGS
+#define TARGET_DEFAULT_TARGET_FLAGS TARGET_DEFAULT
+
+struct gcc_targetm_common targetm_common = TARGETM_COMMON_INITIALIZER;
diff --git a/gcc/common/config/cris/cris-common.c b/gcc/common/config/cris/cris-common.c
new file mode 100644 (file)
index 0000000..e4d30a8
--- /dev/null
@@ -0,0 +1,105 @@
+/* Common hooks for CRIS.
+   Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007,
+   2008, 2009, 2010, 2011  Free Software Foundation, Inc.
+
+This file is part of GCC.
+
+GCC is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 3, or (at your option)
+any later version.
+
+GCC is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GCC; see the file COPYING3.  If not see
+<http://www.gnu.org/licenses/>.  */
+
+#include "config.h"
+#include "system.h"
+#include "coretypes.h"
+#include "tm.h"
+#include "common/common-target.h"
+#include "common/common-target-def.h"
+#include "opts.h"
+#include "flags.h"
+
+/* Implement TARGET_OPTION_OPTIMIZATION_TABLE.  */
+
+static const struct default_options cris_option_optimization_table[] =
+  {
+    { OPT_LEVELS_2_PLUS, OPT_fomit_frame_pointer, NULL, 1 },
+    { OPT_LEVELS_NONE, 0, NULL, 0 }
+  };
+
+/* TARGET_HANDLE_OPTION worker.  We just store the values into local
+   variables here.  Checks for correct semantics are in
+   cris_option_override.  */
+
+static bool
+cris_handle_option (struct gcc_options *opts,
+                   struct gcc_options *opts_set ATTRIBUTE_UNUSED,
+                   const struct cl_decoded_option *decoded,
+                   location_t loc ATTRIBUTE_UNUSED)
+{
+  size_t code = decoded->opt_index;
+
+  switch (code)
+    {
+    case OPT_metrax100:
+      opts->x_target_flags
+       |= (MASK_SVINTO
+           + MASK_ETRAX4_ADD
+           + MASK_ALIGN_BY_32);
+      break;
+
+    case OPT_mno_etrax100:
+      opts->x_target_flags
+       &= ~(MASK_SVINTO
+            + MASK_ETRAX4_ADD
+            + MASK_ALIGN_BY_32);
+      break;
+
+    case OPT_m32_bit:
+    case OPT_m32bit:
+      opts->x_target_flags
+       |= (MASK_STACK_ALIGN
+           + MASK_CONST_ALIGN
+           + MASK_DATA_ALIGN
+           + MASK_ALIGN_BY_32);
+      break;
+
+    case OPT_m16_bit:
+    case OPT_m16bit:
+      opts->x_target_flags
+       |= (MASK_STACK_ALIGN
+           + MASK_CONST_ALIGN
+           + MASK_DATA_ALIGN);
+      break;
+
+    case OPT_m8_bit:
+    case OPT_m8bit:
+      opts->x_target_flags
+       &= ~(MASK_STACK_ALIGN
+            + MASK_CONST_ALIGN
+            + MASK_DATA_ALIGN);
+      break;
+
+    default:
+      break;
+    }
+
+  return true;
+}
+
+#undef TARGET_DEFAULT_TARGET_FLAGS
+#define TARGET_DEFAULT_TARGET_FLAGS (TARGET_DEFAULT | CRIS_SUBTARGET_DEFAULT)
+#undef TARGET_HANDLE_OPTION
+#define TARGET_HANDLE_OPTION cris_handle_option
+#undef TARGET_OPTION_OPTIMIZATION_TABLE
+#define TARGET_OPTION_OPTIMIZATION_TABLE cris_option_optimization_table
+
+struct gcc_targetm_common targetm_common = TARGETM_COMMON_INITIALIZER;
index 8ea235495cb56480ef017859d3e8797f876b6f44..0f6251e3dc7312b815bceabbce4f743f271566fe 100644 (file)
@@ -21,10 +21,12 @@ along with GCC; see the file COPYING3.  If not see
 #include "config.h"
 #include "system.h"
 #include "coretypes.h"
+#include "tm.h" /* For TARGET_ASM_NAMED_SECTION used in default for
+                  TARGET_HAVE_NAMED_SECTIONS.  */
 #include "common/common-target.h"
 #include "common/common-target-def.h"
 
-/* Do not include tm.h or tm_p.h here; if it is useful for a target to
+/* FIXME: Do not include tm.h or tm_p.h here; if it is useful for a target to
    define some macros for the initializer in a header without defining
    targetm_common itself (for example, because of interactions with
    some hooks depending on the target OS and others on the target
diff --git a/gcc/common/config/fr30/fr30-common.c b/gcc/common/config/fr30/fr30-common.c
new file mode 100644 (file)
index 0000000..d8cc320
--- /dev/null
@@ -0,0 +1,41 @@
+/* Common hooks for FR30.
+   Copyright (C) 1998, 1999, 2000, 2001, 2002, 2004, 2005, 2007, 2008, 2009,
+   2010, 2011 Free Software Foundation, Inc.
+
+   This file is part of GCC.
+
+   GCC is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3, or (at your option)
+   any later version.
+
+   GCC is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with GCC; see the file COPYING3.  If not see
+   <http://www.gnu.org/licenses/>.  */
+
+#include "config.h"
+#include "system.h"
+#include "coretypes.h"
+#include "tm.h"
+#include "common/common-target.h"
+#include "common/common-target-def.h"
+
+/* Implement TARGET_OPTION_OPTIMIZATION_TABLE.  */
+static const struct default_options fr30_option_optimization_table[] =
+  {
+    { OPT_LEVELS_1_PLUS, OPT_fomit_frame_pointer, NULL, 1 },
+    { OPT_LEVELS_NONE, 0, NULL, 0 }
+  };
+
+#undef TARGET_EXCEPT_UNWIND_INFO
+#define TARGET_EXCEPT_UNWIND_INFO sjlj_except_unwind_info
+
+#undef TARGET_OPTION_OPTIMIZATION_TABLE
+#define TARGET_OPTION_OPTIMIZATION_TABLE fr30_option_optimization_table
+
+struct gcc_targetm_common targetm_common = TARGETM_COMMON_INITIALIZER;
diff --git a/gcc/common/config/frv/frv-common.c b/gcc/common/config/frv/frv-common.c
new file mode 100644 (file)
index 0000000..d72f1d5
--- /dev/null
@@ -0,0 +1,55 @@
+/* Copyright (C) 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, 2006, 2007,
+   2008, 2009, 2010, 2011  Free Software Foundation, Inc.
+
+This file is part of GCC.
+
+GCC is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 3, or (at your option)
+any later version.
+
+GCC is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GCC; see the file COPYING3.  If not see
+<http://www.gnu.org/licenses/>.  */
+
+#include "config.h"
+#include "system.h"
+#include "coretypes.h"
+#include "tm.h"
+#include "common/common-target.h"
+#include "common/common-target-def.h"
+#include "opts.h"
+#include "flags.h"
+
+/* Allow us to easily change the default for -malloc-cc.  */
+#ifndef DEFAULT_NO_ALLOC_CC
+#define MASK_DEFAULT_ALLOC_CC  MASK_ALLOC_CC
+#else
+#define MASK_DEFAULT_ALLOC_CC  0
+#endif
+
+/* Implement TARGET_OPTION_OPTIMIZATION_TABLE.  */
+static const struct default_options frv_option_optimization_table[] =
+  {
+    { OPT_LEVELS_1_PLUS, OPT_fomit_frame_pointer, NULL, 1 },
+    { OPT_LEVELS_NONE, 0, NULL, 0 }
+  };
+
+#undef TARGET_DEFAULT_TARGET_FLAGS
+#define TARGET_DEFAULT_TARGET_FLAGS            \
+  (MASK_DEFAULT_ALLOC_CC                       \
+   | MASK_COND_MOVE                            \
+   | MASK_SCC                                  \
+   | MASK_COND_EXEC                            \
+   | MASK_VLIW_BRANCH                          \
+   | MASK_MULTI_CE                             \
+   | MASK_NESTED_CE)
+#undef TARGET_OPTION_OPTIMIZATION_TABLE
+#define TARGET_OPTION_OPTIMIZATION_TABLE frv_option_optimization_table
+
+struct gcc_targetm_common targetm_common = TARGETM_COMMON_INITIALIZER;
diff --git a/gcc/common/config/h8300/h8300-common.c b/gcc/common/config/h8300/h8300-common.c
new file mode 100644 (file)
index 0000000..d5833f6
--- /dev/null
@@ -0,0 +1,49 @@
+/* Common hooks for Renesas H8/300.
+   Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000,
+   2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011
+   Free Software Foundation, Inc.
+
+This file is part of GCC.
+
+GCC is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 3, or (at your option)
+any later version.
+
+GCC is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GCC; see the file COPYING3.  If not see
+<http://www.gnu.org/licenses/>.  */
+
+#include "config.h"
+#include "system.h"
+#include "coretypes.h"
+#include "tm.h"
+#include "common/common-target.h"
+#include "common/common-target-def.h"
+
+/* Implement TARGET_OPTION_OPTIMIZATION_TABLE.  */
+
+static const struct default_options h8300_option_optimization_table[] =
+  {
+    /* Basic block reordering is only beneficial on targets with cache
+       and/or variable-cycle branches where (cycle count taken !=
+       cycle count not taken).  */
+    { OPT_LEVELS_ALL, OPT_freorder_blocks, NULL, 0 },
+    { OPT_LEVELS_NONE, 0, NULL, 0 }
+  };
+
+#undef TARGET_DEFAULT_TARGET_FLAGS
+#define TARGET_DEFAULT_TARGET_FLAGS TARGET_DEFAULT
+
+#undef TARGET_OPTION_OPTIMIZATION_TABLE
+#define TARGET_OPTION_OPTIMIZATION_TABLE h8300_option_optimization_table
+
+#undef TARGET_EXCEPT_UNWIND_INFO
+#define TARGET_EXCEPT_UNWIND_INFO sjlj_except_unwind_info
+
+struct gcc_targetm_common targetm_common = TARGETM_COMMON_INITIALIZER;
diff --git a/gcc/common/config/i386/i386-common.c b/gcc/common/config/i386/i386-common.c
new file mode 100644 (file)
index 0000000..1fd33bd
--- /dev/null
@@ -0,0 +1,638 @@
+/* IA-32 common hooks.
+   Copyright (C) 1988, 1992, 1994, 1995, 1996, 1997, 1998, 1999, 2000,
+   2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011
+   Free Software Foundation, Inc.
+
+This file is part of GCC.
+
+GCC is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 3, or (at your option)
+any later version.
+
+GCC is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GCC; see the file COPYING3.  If not see
+<http://www.gnu.org/licenses/>.  */
+
+#include "config.h"
+#include "system.h"
+#include "coretypes.h"
+#include "diagnostic-core.h"
+#include "tm.h"
+#include "tm_p.h"
+#include "common/common-target.h"
+#include "common/common-target-def.h"
+#include "opts.h"
+#include "flags.h"
+
+/* Define a set of ISAs which are available when a given ISA is
+   enabled.  MMX and SSE ISAs are handled separately.  */
+
+#define OPTION_MASK_ISA_MMX_SET OPTION_MASK_ISA_MMX
+#define OPTION_MASK_ISA_3DNOW_SET \
+  (OPTION_MASK_ISA_3DNOW | OPTION_MASK_ISA_MMX_SET)
+
+#define OPTION_MASK_ISA_SSE_SET OPTION_MASK_ISA_SSE
+#define OPTION_MASK_ISA_SSE2_SET \
+  (OPTION_MASK_ISA_SSE2 | OPTION_MASK_ISA_SSE_SET)
+#define OPTION_MASK_ISA_SSE3_SET \
+  (OPTION_MASK_ISA_SSE3 | OPTION_MASK_ISA_SSE2_SET)
+#define OPTION_MASK_ISA_SSSE3_SET \
+  (OPTION_MASK_ISA_SSSE3 | OPTION_MASK_ISA_SSE3_SET)
+#define OPTION_MASK_ISA_SSE4_1_SET \
+  (OPTION_MASK_ISA_SSE4_1 | OPTION_MASK_ISA_SSSE3_SET)
+#define OPTION_MASK_ISA_SSE4_2_SET \
+  (OPTION_MASK_ISA_SSE4_2 | OPTION_MASK_ISA_SSE4_1_SET)
+#define OPTION_MASK_ISA_AVX_SET \
+  (OPTION_MASK_ISA_AVX | OPTION_MASK_ISA_SSE4_2_SET)
+#define OPTION_MASK_ISA_FMA_SET \
+  (OPTION_MASK_ISA_FMA | OPTION_MASK_ISA_AVX_SET)
+
+/* SSE4 includes both SSE4.1 and SSE4.2. -msse4 should be the same
+   as -msse4.2.  */
+#define OPTION_MASK_ISA_SSE4_SET OPTION_MASK_ISA_SSE4_2_SET
+
+#define OPTION_MASK_ISA_SSE4A_SET \
+  (OPTION_MASK_ISA_SSE4A | OPTION_MASK_ISA_SSE3_SET)
+#define OPTION_MASK_ISA_FMA4_SET \
+  (OPTION_MASK_ISA_FMA4 | OPTION_MASK_ISA_SSE4A_SET \
+   | OPTION_MASK_ISA_AVX_SET)
+#define OPTION_MASK_ISA_XOP_SET \
+  (OPTION_MASK_ISA_XOP | OPTION_MASK_ISA_FMA4_SET)
+#define OPTION_MASK_ISA_LWP_SET \
+  OPTION_MASK_ISA_LWP
+
+/* AES and PCLMUL need SSE2 because they use xmm registers */
+#define OPTION_MASK_ISA_AES_SET \
+  (OPTION_MASK_ISA_AES | OPTION_MASK_ISA_SSE2_SET)
+#define OPTION_MASK_ISA_PCLMUL_SET \
+  (OPTION_MASK_ISA_PCLMUL | OPTION_MASK_ISA_SSE2_SET)
+
+#define OPTION_MASK_ISA_ABM_SET \
+  (OPTION_MASK_ISA_ABM | OPTION_MASK_ISA_POPCNT)
+
+#define OPTION_MASK_ISA_BMI_SET OPTION_MASK_ISA_BMI
+#define OPTION_MASK_ISA_TBM_SET OPTION_MASK_ISA_TBM
+#define OPTION_MASK_ISA_POPCNT_SET OPTION_MASK_ISA_POPCNT
+#define OPTION_MASK_ISA_CX16_SET OPTION_MASK_ISA_CX16
+#define OPTION_MASK_ISA_SAHF_SET OPTION_MASK_ISA_SAHF
+#define OPTION_MASK_ISA_MOVBE_SET OPTION_MASK_ISA_MOVBE
+#define OPTION_MASK_ISA_CRC32_SET OPTION_MASK_ISA_CRC32
+
+#define OPTION_MASK_ISA_FSGSBASE_SET OPTION_MASK_ISA_FSGSBASE
+#define OPTION_MASK_ISA_RDRND_SET OPTION_MASK_ISA_RDRND
+#define OPTION_MASK_ISA_F16C_SET \
+  (OPTION_MASK_ISA_F16C | OPTION_MASK_ISA_AVX_SET)
+
+/* Define a set of ISAs which aren't available when a given ISA is
+   disabled.  MMX and SSE ISAs are handled separately.  */
+
+#define OPTION_MASK_ISA_MMX_UNSET \
+  (OPTION_MASK_ISA_MMX | OPTION_MASK_ISA_3DNOW_UNSET)
+#define OPTION_MASK_ISA_3DNOW_UNSET \
+  (OPTION_MASK_ISA_3DNOW | OPTION_MASK_ISA_3DNOW_A_UNSET)
+#define OPTION_MASK_ISA_3DNOW_A_UNSET OPTION_MASK_ISA_3DNOW_A
+
+#define OPTION_MASK_ISA_SSE_UNSET \
+  (OPTION_MASK_ISA_SSE | OPTION_MASK_ISA_SSE2_UNSET)
+#define OPTION_MASK_ISA_SSE2_UNSET \
+  (OPTION_MASK_ISA_SSE2 | OPTION_MASK_ISA_SSE3_UNSET)
+#define OPTION_MASK_ISA_SSE3_UNSET \
+  (OPTION_MASK_ISA_SSE3 \
+   | OPTION_MASK_ISA_SSSE3_UNSET \
+   | OPTION_MASK_ISA_SSE4A_UNSET )
+#define OPTION_MASK_ISA_SSSE3_UNSET \
+  (OPTION_MASK_ISA_SSSE3 | OPTION_MASK_ISA_SSE4_1_UNSET)
+#define OPTION_MASK_ISA_SSE4_1_UNSET \
+  (OPTION_MASK_ISA_SSE4_1 | OPTION_MASK_ISA_SSE4_2_UNSET)
+#define OPTION_MASK_ISA_SSE4_2_UNSET \
+  (OPTION_MASK_ISA_SSE4_2 | OPTION_MASK_ISA_AVX_UNSET )
+#define OPTION_MASK_ISA_AVX_UNSET \
+  (OPTION_MASK_ISA_AVX | OPTION_MASK_ISA_FMA_UNSET \
+   | OPTION_MASK_ISA_FMA4_UNSET | OPTION_MASK_ISA_F16C_UNSET)
+#define OPTION_MASK_ISA_FMA_UNSET OPTION_MASK_ISA_FMA
+
+/* SSE4 includes both SSE4.1 and SSE4.2.  -mno-sse4 should the same
+   as -mno-sse4.1. */
+#define OPTION_MASK_ISA_SSE4_UNSET OPTION_MASK_ISA_SSE4_1_UNSET
+
+#define OPTION_MASK_ISA_SSE4A_UNSET \
+  (OPTION_MASK_ISA_SSE4A | OPTION_MASK_ISA_FMA4_UNSET)
+
+#define OPTION_MASK_ISA_FMA4_UNSET \
+  (OPTION_MASK_ISA_FMA4 | OPTION_MASK_ISA_XOP_UNSET)
+#define OPTION_MASK_ISA_XOP_UNSET OPTION_MASK_ISA_XOP
+#define OPTION_MASK_ISA_LWP_UNSET OPTION_MASK_ISA_LWP
+
+#define OPTION_MASK_ISA_AES_UNSET OPTION_MASK_ISA_AES
+#define OPTION_MASK_ISA_PCLMUL_UNSET OPTION_MASK_ISA_PCLMUL
+#define OPTION_MASK_ISA_ABM_UNSET OPTION_MASK_ISA_ABM
+#define OPTION_MASK_ISA_BMI_UNSET OPTION_MASK_ISA_BMI
+#define OPTION_MASK_ISA_TBM_UNSET OPTION_MASK_ISA_TBM
+#define OPTION_MASK_ISA_POPCNT_UNSET OPTION_MASK_ISA_POPCNT
+#define OPTION_MASK_ISA_CX16_UNSET OPTION_MASK_ISA_CX16
+#define OPTION_MASK_ISA_SAHF_UNSET OPTION_MASK_ISA_SAHF
+#define OPTION_MASK_ISA_MOVBE_UNSET OPTION_MASK_ISA_MOVBE
+#define OPTION_MASK_ISA_CRC32_UNSET OPTION_MASK_ISA_CRC32
+
+#define OPTION_MASK_ISA_FSGSBASE_UNSET OPTION_MASK_ISA_FSGSBASE
+#define OPTION_MASK_ISA_RDRND_UNSET OPTION_MASK_ISA_RDRND
+#define OPTION_MASK_ISA_F16C_UNSET OPTION_MASK_ISA_F16C
+
+/* Implement TARGET_HANDLE_OPTION.  */
+
+bool
+ix86_handle_option (struct gcc_options *opts,
+                   struct gcc_options *opts_set ATTRIBUTE_UNUSED,
+                   const struct cl_decoded_option *decoded,
+                   location_t loc)
+{
+  size_t code = decoded->opt_index;
+  int value = decoded->value;
+
+  switch (code)
+    {
+    case OPT_mmmx:
+      if (value)
+       {
+         opts->x_ix86_isa_flags |= OPTION_MASK_ISA_MMX_SET;
+         opts->x_ix86_isa_flags_explicit |= OPTION_MASK_ISA_MMX_SET;
+       }
+      else
+       {
+         opts->x_ix86_isa_flags &= ~OPTION_MASK_ISA_MMX_UNSET;
+         opts->x_ix86_isa_flags_explicit |= OPTION_MASK_ISA_MMX_UNSET;
+       }
+      return true;
+
+    case OPT_m3dnow:
+      if (value)
+       {
+         opts->x_ix86_isa_flags |= OPTION_MASK_ISA_3DNOW_SET;
+         opts->x_ix86_isa_flags_explicit |= OPTION_MASK_ISA_3DNOW_SET;
+       }
+      else
+       {
+         opts->x_ix86_isa_flags &= ~OPTION_MASK_ISA_3DNOW_UNSET;
+         opts->x_ix86_isa_flags_explicit |= OPTION_MASK_ISA_3DNOW_UNSET;
+       }
+      return true;
+
+    case OPT_m3dnowa:
+      return false;
+
+    case OPT_msse:
+      if (value)
+       {
+         opts->x_ix86_isa_flags |= OPTION_MASK_ISA_SSE_SET;
+         opts->x_ix86_isa_flags_explicit |= OPTION_MASK_ISA_SSE_SET;
+       }
+      else
+       {
+         opts->x_ix86_isa_flags &= ~OPTION_MASK_ISA_SSE_UNSET;
+         opts->x_ix86_isa_flags_explicit |= OPTION_MASK_ISA_SSE_UNSET;
+       }
+      return true;
+
+    case OPT_msse2:
+      if (value)
+       {
+         opts->x_ix86_isa_flags |= OPTION_MASK_ISA_SSE2_SET;
+         opts->x_ix86_isa_flags_explicit |= OPTION_MASK_ISA_SSE2_SET;
+       }
+      else
+       {
+         opts->x_ix86_isa_flags &= ~OPTION_MASK_ISA_SSE2_UNSET;
+         opts->x_ix86_isa_flags_explicit |= OPTION_MASK_ISA_SSE2_UNSET;
+       }
+      return true;
+
+    case OPT_msse3:
+      if (value)
+       {
+         opts->x_ix86_isa_flags |= OPTION_MASK_ISA_SSE3_SET;
+         opts->x_ix86_isa_flags_explicit |= OPTION_MASK_ISA_SSE3_SET;
+       }
+      else
+       {
+         opts->x_ix86_isa_flags &= ~OPTION_MASK_ISA_SSE3_UNSET;
+         opts->x_ix86_isa_flags_explicit |= OPTION_MASK_ISA_SSE3_UNSET;
+       }
+      return true;
+
+    case OPT_mssse3:
+      if (value)
+       {
+         opts->x_ix86_isa_flags |= OPTION_MASK_ISA_SSSE3_SET;
+         opts->x_ix86_isa_flags_explicit |= OPTION_MASK_ISA_SSSE3_SET;
+       }
+      else
+       {
+         opts->x_ix86_isa_flags &= ~OPTION_MASK_ISA_SSSE3_UNSET;
+         opts->x_ix86_isa_flags_explicit |= OPTION_MASK_ISA_SSSE3_UNSET;
+       }
+      return true;
+
+    case OPT_msse4_1:
+      if (value)
+       {
+         opts->x_ix86_isa_flags |= OPTION_MASK_ISA_SSE4_1_SET;
+         opts->x_ix86_isa_flags_explicit |= OPTION_MASK_ISA_SSE4_1_SET;
+       }
+      else
+       {
+         opts->x_ix86_isa_flags &= ~OPTION_MASK_ISA_SSE4_1_UNSET;
+         opts->x_ix86_isa_flags_explicit |= OPTION_MASK_ISA_SSE4_1_UNSET;
+       }
+      return true;
+
+    case OPT_msse4_2:
+      if (value)
+       {
+         opts->x_ix86_isa_flags |= OPTION_MASK_ISA_SSE4_2_SET;
+         opts->x_ix86_isa_flags_explicit |= OPTION_MASK_ISA_SSE4_2_SET;
+       }
+      else
+       {
+         opts->x_ix86_isa_flags &= ~OPTION_MASK_ISA_SSE4_2_UNSET;
+         opts->x_ix86_isa_flags_explicit |= OPTION_MASK_ISA_SSE4_2_UNSET;
+       }
+      return true;
+
+    case OPT_mavx:
+      if (value)
+       {
+         opts->x_ix86_isa_flags |= OPTION_MASK_ISA_AVX_SET;
+         opts->x_ix86_isa_flags_explicit |= OPTION_MASK_ISA_AVX_SET;
+       }
+      else
+       {
+         opts->x_ix86_isa_flags &= ~OPTION_MASK_ISA_AVX_UNSET;
+         opts->x_ix86_isa_flags_explicit |= OPTION_MASK_ISA_AVX_UNSET;
+       }
+      return true;
+
+    case OPT_mfma:
+      if (value)
+       {
+         opts->x_ix86_isa_flags |= OPTION_MASK_ISA_FMA_SET;
+         opts->x_ix86_isa_flags_explicit |= OPTION_MASK_ISA_FMA_SET;
+       }
+      else
+       {
+         opts->x_ix86_isa_flags &= ~OPTION_MASK_ISA_FMA_UNSET;
+         opts->x_ix86_isa_flags_explicit |= OPTION_MASK_ISA_FMA_UNSET;
+       }
+      return true;
+
+    case OPT_msse4:
+      opts->x_ix86_isa_flags |= OPTION_MASK_ISA_SSE4_SET;
+      opts->x_ix86_isa_flags_explicit |= OPTION_MASK_ISA_SSE4_SET;
+      return true;
+
+    case OPT_mno_sse4:
+      opts->x_ix86_isa_flags &= ~OPTION_MASK_ISA_SSE4_UNSET;
+      opts->x_ix86_isa_flags_explicit |= OPTION_MASK_ISA_SSE4_UNSET;
+      return true;
+
+    case OPT_msse4a:
+      if (value)
+       {
+         opts->x_ix86_isa_flags |= OPTION_MASK_ISA_SSE4A_SET;
+         opts->x_ix86_isa_flags_explicit |= OPTION_MASK_ISA_SSE4A_SET;
+       }
+      else
+       {
+         opts->x_ix86_isa_flags &= ~OPTION_MASK_ISA_SSE4A_UNSET;
+         opts->x_ix86_isa_flags_explicit |= OPTION_MASK_ISA_SSE4A_UNSET;
+       }
+      return true;
+
+    case OPT_mfma4:
+      if (value)
+       {
+         opts->x_ix86_isa_flags |= OPTION_MASK_ISA_FMA4_SET;
+         opts->x_ix86_isa_flags_explicit |= OPTION_MASK_ISA_FMA4_SET;
+       }
+      else
+       {
+         opts->x_ix86_isa_flags &= ~OPTION_MASK_ISA_FMA4_UNSET;
+         opts->x_ix86_isa_flags_explicit |= OPTION_MASK_ISA_FMA4_UNSET;
+       }
+      return true;
+
+   case OPT_mxop:
+      if (value)
+       {
+         opts->x_ix86_isa_flags |= OPTION_MASK_ISA_XOP_SET;
+         opts->x_ix86_isa_flags_explicit |= OPTION_MASK_ISA_XOP_SET;
+       }
+      else
+       {
+         opts->x_ix86_isa_flags &= ~OPTION_MASK_ISA_XOP_UNSET;
+         opts->x_ix86_isa_flags_explicit |= OPTION_MASK_ISA_XOP_UNSET;
+       }
+      return true;
+
+   case OPT_mlwp:
+      if (value)
+       {
+         opts->x_ix86_isa_flags |= OPTION_MASK_ISA_LWP_SET;
+         opts->x_ix86_isa_flags_explicit |= OPTION_MASK_ISA_LWP_SET;
+       }
+      else
+       {
+         opts->x_ix86_isa_flags &= ~OPTION_MASK_ISA_LWP_UNSET;
+         opts->x_ix86_isa_flags_explicit |= OPTION_MASK_ISA_LWP_UNSET;
+       }
+      return true;
+
+    case OPT_mabm:
+      if (value)
+       {
+         opts->x_ix86_isa_flags |= OPTION_MASK_ISA_ABM_SET;
+         opts->x_ix86_isa_flags_explicit |= OPTION_MASK_ISA_ABM_SET;
+       }
+      else
+       {
+         opts->x_ix86_isa_flags &= ~OPTION_MASK_ISA_ABM_UNSET;
+         opts->x_ix86_isa_flags_explicit |= OPTION_MASK_ISA_ABM_UNSET;
+       }
+      return true;
+
+    case OPT_mbmi:
+      if (value)
+       {
+         opts->x_ix86_isa_flags |= OPTION_MASK_ISA_BMI_SET;
+         opts->x_ix86_isa_flags_explicit |= OPTION_MASK_ISA_BMI_SET;
+       }
+      else
+       {
+         opts->x_ix86_isa_flags &= ~OPTION_MASK_ISA_BMI_UNSET;
+         opts->x_ix86_isa_flags_explicit |= OPTION_MASK_ISA_BMI_UNSET;
+       }
+      return true;
+
+    case OPT_mtbm:
+      if (value)
+       {
+         opts->x_ix86_isa_flags |= OPTION_MASK_ISA_TBM_SET;
+         opts->x_ix86_isa_flags_explicit |= OPTION_MASK_ISA_TBM_SET;
+       }
+      else
+       {
+         opts->x_ix86_isa_flags &= ~OPTION_MASK_ISA_TBM_UNSET;
+         opts->x_ix86_isa_flags_explicit |= OPTION_MASK_ISA_TBM_UNSET;
+       }
+      return true;
+
+    case OPT_mpopcnt:
+      if (value)
+       {
+         opts->x_ix86_isa_flags |= OPTION_MASK_ISA_POPCNT_SET;
+         opts->x_ix86_isa_flags_explicit |= OPTION_MASK_ISA_POPCNT_SET;
+       }
+      else
+       {
+         opts->x_ix86_isa_flags &= ~OPTION_MASK_ISA_POPCNT_UNSET;
+         opts->x_ix86_isa_flags_explicit |= OPTION_MASK_ISA_POPCNT_UNSET;
+       }
+      return true;
+
+    case OPT_msahf:
+      if (value)
+       {
+         opts->x_ix86_isa_flags |= OPTION_MASK_ISA_SAHF_SET;
+         opts->x_ix86_isa_flags_explicit |= OPTION_MASK_ISA_SAHF_SET;
+       }
+      else
+       {
+         opts->x_ix86_isa_flags &= ~OPTION_MASK_ISA_SAHF_UNSET;
+         opts->x_ix86_isa_flags_explicit |= OPTION_MASK_ISA_SAHF_UNSET;
+       }
+      return true;
+
+    case OPT_mcx16:
+      if (value)
+       {
+         opts->x_ix86_isa_flags |= OPTION_MASK_ISA_CX16_SET;
+         opts->x_ix86_isa_flags_explicit |= OPTION_MASK_ISA_CX16_SET;
+       }
+      else
+       {
+         opts->x_ix86_isa_flags &= ~OPTION_MASK_ISA_CX16_UNSET;
+         opts->x_ix86_isa_flags_explicit |= OPTION_MASK_ISA_CX16_UNSET;
+       }
+      return true;
+
+    case OPT_mmovbe:
+      if (value)
+       {
+         opts->x_ix86_isa_flags |= OPTION_MASK_ISA_MOVBE_SET;
+         opts->x_ix86_isa_flags_explicit |= OPTION_MASK_ISA_MOVBE_SET;
+       }
+      else
+       {
+         opts->x_ix86_isa_flags &= ~OPTION_MASK_ISA_MOVBE_UNSET;
+         opts->x_ix86_isa_flags_explicit |= OPTION_MASK_ISA_MOVBE_UNSET;
+       }
+      return true;
+
+    case OPT_mcrc32:
+      if (value)
+       {
+         opts->x_ix86_isa_flags |= OPTION_MASK_ISA_CRC32_SET;
+         opts->x_ix86_isa_flags_explicit |= OPTION_MASK_ISA_CRC32_SET;
+       }
+      else
+       {
+         opts->x_ix86_isa_flags &= ~OPTION_MASK_ISA_CRC32_UNSET;
+         opts->x_ix86_isa_flags_explicit |= OPTION_MASK_ISA_CRC32_UNSET;
+       }
+      return true;
+
+    case OPT_maes:
+      if (value)
+       {
+         opts->x_ix86_isa_flags |= OPTION_MASK_ISA_AES_SET;
+         opts->x_ix86_isa_flags_explicit |= OPTION_MASK_ISA_AES_SET;
+       }
+      else
+       {
+         opts->x_ix86_isa_flags &= ~OPTION_MASK_ISA_AES_UNSET;
+         opts->x_ix86_isa_flags_explicit |= OPTION_MASK_ISA_AES_UNSET;
+       }
+      return true;
+
+    case OPT_mpclmul:
+      if (value)
+       {
+         opts->x_ix86_isa_flags |= OPTION_MASK_ISA_PCLMUL_SET;
+         opts->x_ix86_isa_flags_explicit |= OPTION_MASK_ISA_PCLMUL_SET;
+       }
+      else
+       {
+         opts->x_ix86_isa_flags &= ~OPTION_MASK_ISA_PCLMUL_UNSET;
+         opts->x_ix86_isa_flags_explicit |= OPTION_MASK_ISA_PCLMUL_UNSET;
+       }
+      return true;
+
+    case OPT_mfsgsbase:
+      if (value)
+       {
+         opts->x_ix86_isa_flags |= OPTION_MASK_ISA_FSGSBASE_SET;
+         opts->x_ix86_isa_flags_explicit |= OPTION_MASK_ISA_FSGSBASE_SET;
+       }
+      else
+       {
+         opts->x_ix86_isa_flags &= ~OPTION_MASK_ISA_FSGSBASE_UNSET;
+         opts->x_ix86_isa_flags_explicit |= OPTION_MASK_ISA_FSGSBASE_UNSET;
+       }
+      return true;
+
+    case OPT_mrdrnd:
+      if (value)
+       {
+         opts->x_ix86_isa_flags |= OPTION_MASK_ISA_RDRND_SET;
+         opts->x_ix86_isa_flags_explicit |= OPTION_MASK_ISA_RDRND_SET;
+       }
+      else
+       {
+         opts->x_ix86_isa_flags &= ~OPTION_MASK_ISA_RDRND_UNSET;
+         opts->x_ix86_isa_flags_explicit |= OPTION_MASK_ISA_RDRND_UNSET;
+       }
+      return true;
+
+    case OPT_mf16c:
+      if (value)
+       {
+         opts->x_ix86_isa_flags |= OPTION_MASK_ISA_F16C_SET;
+         opts->x_ix86_isa_flags_explicit |= OPTION_MASK_ISA_F16C_SET;
+       }
+      else
+       {
+         opts->x_ix86_isa_flags &= ~OPTION_MASK_ISA_F16C_UNSET;
+         opts->x_ix86_isa_flags_explicit |= OPTION_MASK_ISA_F16C_UNSET;
+       }
+      return true;
+
+  /* Comes from final.c -- no real reason to change it.  */
+#define MAX_CODE_ALIGN 16
+
+    case OPT_malign_loops_:
+      warning_at (loc, 0, "-malign-loops is obsolete, use -falign-loops");
+      if (value > MAX_CODE_ALIGN)
+       error_at (loc, "-malign-loops=%d is not between 0 and %d",
+                 value, MAX_CODE_ALIGN);
+      else
+       opts->x_align_loops = 1 << value;
+      return true;
+
+    case OPT_malign_jumps_:
+      warning_at (loc, 0, "-malign-jumps is obsolete, use -falign-jumps");
+      if (value > MAX_CODE_ALIGN)
+       error_at (loc, "-malign-jumps=%d is not between 0 and %d",
+                 value, MAX_CODE_ALIGN);
+      else
+       opts->x_align_jumps = 1 << value;
+      return true;
+
+    case OPT_malign_functions_:
+      warning_at (loc, 0,
+                 "-malign-functions is obsolete, use -falign-functions");
+      if (value > MAX_CODE_ALIGN)
+       error_at (loc, "-malign-functions=%d is not between 0 and %d",
+                 value, MAX_CODE_ALIGN);
+      else
+       opts->x_align_functions = 1 << value;
+      return true;
+
+    case OPT_mbranch_cost_:
+      if (value > 5)
+       {
+         error_at (loc, "-mbranch-cost=%d is not between 0 and 5", value);
+         opts->x_ix86_branch_cost = 5;
+       }
+      return true;
+
+    default:
+      return true;
+    }
+}
+
+static const struct default_options ix86_option_optimization_table[] =
+  {
+    /* Turn off -fschedule-insns by default.  It tends to make the
+       problem with not enough registers even worse.  */
+    { OPT_LEVELS_ALL, OPT_fschedule_insns, NULL, 0 },
+
+#ifdef SUBTARGET_OPTIMIZATION_OPTIONS
+    SUBTARGET_OPTIMIZATION_OPTIONS,
+#endif
+    { OPT_LEVELS_NONE, 0, NULL, 0 }
+  };
+
+/* Implement TARGET_OPTION_INIT_STRUCT.  */
+
+static void
+ix86_option_init_struct (struct gcc_options *opts)
+{
+  if (TARGET_MACHO)
+    /* The Darwin libraries never set errno, so we might as well
+       avoid calling them when that's the only reason we would.  */
+    opts->x_flag_errno_math = 0;
+
+  opts->x_flag_pcc_struct_return = 2;
+  opts->x_flag_asynchronous_unwind_tables = 2;
+  opts->x_flag_vect_cost_model = 1;
+}
+
+/* On the x86 -fsplit-stack and -fstack-protector both use the same
+   field in the TCB, so they can not be used together.  */
+
+static bool
+ix86_supports_split_stack (bool report ATTRIBUTE_UNUSED,
+                          struct gcc_options *opts ATTRIBUTE_UNUSED)
+{
+  bool ret = true;
+
+#ifndef TARGET_THREAD_SPLIT_STACK_OFFSET
+  if (report)
+    error ("%<-fsplit-stack%> currently only supported on GNU/Linux");
+  ret = false;
+#else
+  if (!HAVE_GAS_CFI_PERSONALITY_DIRECTIVE)
+    {
+      if (report)
+       error ("%<-fsplit-stack%> requires "
+              "assembler support for CFI directives");
+      ret = false;
+    }
+#endif
+
+  return ret;
+}
+
+#undef TARGET_DEFAULT_TARGET_FLAGS
+#define TARGET_DEFAULT_TARGET_FLAGS    \
+  (TARGET_DEFAULT                      \
+   | TARGET_SUBTARGET_DEFAULT          \
+   | TARGET_TLS_DIRECT_SEG_REFS_DEFAULT)
+
+#undef TARGET_HANDLE_OPTION
+#define TARGET_HANDLE_OPTION ix86_handle_option
+
+#undef TARGET_OPTION_OPTIMIZATION_TABLE
+#define TARGET_OPTION_OPTIMIZATION_TABLE ix86_option_optimization_table
+#undef TARGET_OPTION_INIT_STRUCT
+#define TARGET_OPTION_INIT_STRUCT ix86_option_init_struct
+
+#undef TARGET_SUPPORTS_SPLIT_STACK
+#define TARGET_SUPPORTS_SPLIT_STACK ix86_supports_split_stack
+
+struct gcc_targetm_common targetm_common = TARGETM_COMMON_INITIALIZER;
diff --git a/gcc/common/config/ia64/ia64-common.c b/gcc/common/config/ia64/ia64-common.c
new file mode 100644 (file)
index 0000000..8c86ff4
--- /dev/null
@@ -0,0 +1,97 @@
+/* Common hooks for IA64.
+   Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008,
+   2009, 2010, 2011
+   Free Software Foundation, Inc.
+
+This file is part of GCC.
+
+GCC is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 3, or (at your option)
+any later version.
+
+GCC is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GCC; see the file COPYING3.  If not see
+<http://www.gnu.org/licenses/>.  */
+
+#include "config.h"
+#include "system.h"
+#include "coretypes.h"
+#include "diagnostic-core.h"
+#include "tm.h"
+#include "tm_p.h"
+#include "common/common-target.h"
+#include "common/common-target-def.h"
+#include "opts.h"
+#include "flags.h"
+
+/* Implement overriding of the optimization options.  */
+static const struct default_options ia64_option_optimization_table[] =
+  {
+    { OPT_LEVELS_1_PLUS, OPT_fomit_frame_pointer, NULL, 1 },
+#ifdef SUBTARGET_OPTIMIZATION_OPTIONS
+    SUBTARGET_OPTIMIZATION_OPTIONS,
+#endif
+    { OPT_LEVELS_NONE, 0, NULL, 0 }
+  };
+
+/* Implement TARGET_HANDLE_OPTION.  */
+
+static bool
+ia64_handle_option (struct gcc_options *opts ATTRIBUTE_UNUSED,
+                   struct gcc_options *opts_set ATTRIBUTE_UNUSED,
+                   const struct cl_decoded_option *decoded,
+                   location_t loc)
+{
+  size_t code = decoded->opt_index;
+  const char *arg = decoded->arg;
+  int value = decoded->value;
+
+  switch (code)
+    {
+    case OPT_mtls_size_:
+      if (value != 14 && value != 22 && value != 64)
+       error_at (loc, "bad value %<%s%> for -mtls-size= switch", arg);
+      return true;
+
+    default:
+      return true;
+    }
+}
+
+/* Implement TARGET_EXCEPT_UNWIND_INFO.  */
+
+enum unwind_info_type
+ia64_except_unwind_info (struct gcc_options *opts)
+{
+  /* Honor the --enable-sjlj-exceptions configure switch.  */
+#ifdef CONFIG_UNWIND_EXCEPTIONS
+  if (CONFIG_UNWIND_EXCEPTIONS)
+    return UI_SJLJ;
+#endif
+
+  /* For simplicity elsewhere in this file, indicate that all unwind
+     info is disabled if we're not emitting unwind tables.  */
+  if (!opts->x_flag_exceptions && !opts->x_flag_unwind_tables)
+    return UI_NONE;
+
+  return UI_TARGET;
+}
+
+#undef TARGET_OPTION_OPTIMIZATION_TABLE
+#define TARGET_OPTION_OPTIMIZATION_TABLE ia64_option_optimization_table
+
+#undef TARGET_EXCEPT_UNWIND_INFO
+#define TARGET_EXCEPT_UNWIND_INFO  ia64_except_unwind_info
+
+#undef TARGET_DEFAULT_TARGET_FLAGS
+#define TARGET_DEFAULT_TARGET_FLAGS (TARGET_DEFAULT | TARGET_CPU_DEFAULT)
+#undef TARGET_HANDLE_OPTION
+#define TARGET_HANDLE_OPTION ia64_handle_option
+
+struct gcc_targetm_common targetm_common = TARGETM_COMMON_INITIALIZER;
diff --git a/gcc/common/config/iq2000/iq2000-common.c b/gcc/common/config/iq2000/iq2000-common.c
new file mode 100644 (file)
index 0000000..4eb32be
--- /dev/null
@@ -0,0 +1,38 @@
+/* Common hooks for Vitesse IQ2000.
+   Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011
+   Free Software Foundation, Inc.
+
+This file is part of GCC.
+
+GCC is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 3, or (at your option)
+any later version.
+
+GCC is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GCC; see the file COPYING3.  If not see
+<http://www.gnu.org/licenses/>.  */
+
+#include "config.h"
+#include "system.h"
+#include "coretypes.h"
+#include "tm.h"
+#include "common/common-target.h"
+#include "common/common-target-def.h"
+
+/* Implement TARGET_OPTION_OPTIMIZATION_TABLE.  */
+static const struct default_options iq2000_option_optimization_table[] =
+  {
+    { OPT_LEVELS_1_PLUS, OPT_fomit_frame_pointer, NULL, 1 },
+    { OPT_LEVELS_NONE, 0, NULL, 0 }
+  };
+
+#undef  TARGET_OPTION_OPTIMIZATION_TABLE
+#define TARGET_OPTION_OPTIMIZATION_TABLE iq2000_option_optimization_table
+
+struct gcc_targetm_common targetm_common = TARGETM_COMMON_INITIALIZER;
diff --git a/gcc/common/config/lm32/lm32-common.c b/gcc/common/config/lm32/lm32-common.c
new file mode 100644 (file)
index 0000000..a8f674d
--- /dev/null
@@ -0,0 +1,41 @@
+/* Common hooks for Lattice Mico32.
+
+   Copyright (C) 2009, 2010, 2011 Free Software Foundation, Inc.
+
+   This file is part of GCC.
+
+   GCC is free software; you can redistribute it and/or modify it
+   under the terms of the GNU General Public License as published
+   by the Free Software Foundation; either version 3, or (at your
+   option) any later version.
+
+   GCC is distributed in the hope that it will be useful, but WITHOUT
+   ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+   or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public
+   License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with GCC; see the file COPYING3.  If not see
+   <http://www.gnu.org/licenses/>.  */
+
+#include "config.h"
+#include "system.h"
+#include "coretypes.h"
+#include "tm.h"
+#include "common/common-target.h"
+#include "common/common-target-def.h"
+
+/* Implement TARGET_OPTION_OPTIMIZATION_TABLE.  */
+static const struct default_options lm32_option_optimization_table[] =
+  {
+    { OPT_LEVELS_1_PLUS, OPT_fomit_frame_pointer, NULL, 1 },
+    { OPT_LEVELS_NONE, 0, NULL, 0 }
+  };
+
+#undef TARGET_OPTION_OPTIMIZATION_TABLE
+#define TARGET_OPTION_OPTIMIZATION_TABLE lm32_option_optimization_table
+
+#undef TARGET_EXCEPT_UNWIND_INFO
+#define TARGET_EXCEPT_UNWIND_INFO sjlj_except_unwind_info
+
+struct gcc_targetm_common targetm_common = TARGETM_COMMON_INITIALIZER;
diff --git a/gcc/common/config/m32c/m32c-common.c b/gcc/common/config/m32c/m32c-common.c
new file mode 100644 (file)
index 0000000..8bda8cd
--- /dev/null
@@ -0,0 +1,31 @@
+/* Common hooks for R8C/M16C/M32C.
+   Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2011
+   Free Software Foundation, Inc.
+
+   This file is part of GCC.
+
+   GCC is free software; you can redistribute it and/or modify it
+   under the terms of the GNU General Public License as published
+   by the Free Software Foundation; either version 3, or (at your
+   option) any later version.
+
+   GCC is distributed in the hope that it will be useful, but WITHOUT
+   ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+   or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public
+   License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with GCC; see the file COPYING3.  If not see
+   <http://www.gnu.org/licenses/>.  */
+
+#include "config.h"
+#include "system.h"
+#include "coretypes.h"
+#include "tm.h"
+#include "common/common-target.h"
+#include "common/common-target-def.h"
+
+#undef TARGET_HAVE_NAMED_SECTIONS
+#define TARGET_HAVE_NAMED_SECTIONS true
+
+struct gcc_targetm_common targetm_common = TARGETM_COMMON_INITIALIZER;
diff --git a/gcc/common/config/m32r/m32r-common.c b/gcc/common/config/m32r/m32r-common.c
new file mode 100644 (file)
index 0000000..99dca2d
--- /dev/null
@@ -0,0 +1,76 @@
+/* Common hooks for Renesas M32R.
+   Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
+   2005, 2007, 2008, 2009, 2010, 2011 Free Software Foundation, Inc.
+
+   This file is part of GCC.
+
+   GCC is free software; you can redistribute it and/or modify it
+   under the terms of the GNU General Public License as published
+   by the Free Software Foundation; either version 3, or (at your
+   option) any later version.
+
+   GCC is distributed in the hope that it will be useful, but WITHOUT
+   ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+   or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public
+   License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with GCC; see the file COPYING3.  If not see
+   <http://www.gnu.org/licenses/>.  */
+
+#include "config.h"
+#include "system.h"
+#include "coretypes.h"
+#include "tm.h"
+#include "common/common-target.h"
+#include "common/common-target-def.h"
+#include "opts.h"
+#include "flags.h"
+
+static const struct default_options m32r_option_optimization_table[] =
+  {
+    { OPT_LEVELS_1_PLUS, OPT_fomit_frame_pointer, NULL, 1 },
+    { OPT_LEVELS_1_PLUS, OPT_fregmove, NULL, 1 },
+    { OPT_LEVELS_NONE, 0, NULL, 0 }
+  };
+
+/* Implement TARGET_HANDLE_OPTION.  */
+
+static bool
+m32r_handle_option (struct gcc_options *opts,
+                   struct gcc_options *opts_set ATTRIBUTE_UNUSED,
+                   const struct cl_decoded_option *decoded,
+                   location_t loc ATTRIBUTE_UNUSED)
+{
+  size_t code = decoded->opt_index;
+  int value = decoded->value;
+
+  switch (code)
+    {
+    case OPT_m32r:
+      opts->x_target_flags &= ~(MASK_M32R2 | MASK_M32RX);
+      return true;
+
+    case OPT_mno_flush_func:
+      opts->x_m32r_cache_flush_func = NULL;
+      return true;
+
+    case OPT_mflush_trap_:
+      return value <= 15;
+
+    default:
+      return true;
+    }
+}
+
+#undef  TARGET_DEFAULT_TARGET_FLAGS
+#define TARGET_DEFAULT_TARGET_FLAGS TARGET_CPU_DEFAULT
+#undef  TARGET_HANDLE_OPTION
+#define TARGET_HANDLE_OPTION m32r_handle_option
+#undef  TARGET_OPTION_OPTIMIZATION_TABLE
+#define TARGET_OPTION_OPTIMIZATION_TABLE m32r_option_optimization_table
+
+#undef  TARGET_EXCEPT_UNWIND_INFO
+#define TARGET_EXCEPT_UNWIND_INFO              sjlj_except_unwind_info
+
+struct gcc_targetm_common targetm_common = TARGETM_COMMON_INITIALIZER;
diff --git a/gcc/common/config/m68k/m68k-common.c b/gcc/common/config/m68k/m68k-common.c
new file mode 100644 (file)
index 0000000..3a81b67
--- /dev/null
@@ -0,0 +1,76 @@
+/* Common hooks for Motorola 68000 family.
+   Copyright (C) 1987, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000,
+   2001, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011
+   Free Software Foundation, Inc.
+
+This file is part of GCC.
+
+GCC is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 3, or (at your option)
+any later version.
+
+GCC is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GCC; see the file COPYING3.  If not see
+<http://www.gnu.org/licenses/>.  */
+
+#include "config.h"
+#include "system.h"
+#include "coretypes.h"
+#include "diagnostic-core.h"
+#include "tm.h"
+#include "common/common-target.h"
+#include "common/common-target-def.h"
+#include "opts.h"
+#include "flags.h"
+
+/* Implement TARGET_HANDLE_OPTION.  */
+
+static bool
+m68k_handle_option (struct gcc_options *opts,
+                   struct gcc_options *opts_set ATTRIBUTE_UNUSED,
+                   const struct cl_decoded_option *decoded,
+                   location_t loc)
+{
+  size_t code = decoded->opt_index;
+  const char *arg = decoded->arg;
+  int value = decoded->value;
+
+  switch (code)
+    {
+    case OPT_m68020_40:
+      opts->x_m68k_tune_option = u68020_40;
+      opts->x_m68k_cpu_option = m68020;
+      return true;
+
+    case OPT_m68020_60:
+      opts->x_m68k_tune_option = u68020_60;
+      opts->x_m68k_cpu_option = m68020;
+      return true;
+
+    case OPT_mshared_library_id_:
+      if (value > MAX_LIBRARY_ID)
+       error_at (loc, "-mshared-library-id=%s is not between 0 and %d",
+                 arg, MAX_LIBRARY_ID);
+      else
+        {
+         char *tmp;
+         asprintf (&tmp, "%d", (value * -4) - 4);
+         opts->x_m68k_library_id_string = tmp;
+       }
+      return true;
+
+    default:
+      return true;
+    }
+}
+
+#undef TARGET_HANDLE_OPTION
+#define TARGET_HANDLE_OPTION m68k_handle_option
+
+struct gcc_targetm_common targetm_common = TARGETM_COMMON_INITIALIZER;
diff --git a/gcc/common/config/mcore/mcore-common.c b/gcc/common/config/mcore/mcore-common.c
new file mode 100644 (file)
index 0000000..66633bf
--- /dev/null
@@ -0,0 +1,54 @@
+/* Common hooks for Motorola MCore.
+   Copyright (C) 1993, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2007, 2008,
+   2009, 2010, 2011 Free Software Foundation, Inc.
+
+   This file is part of GCC.
+
+   GCC is free software; you can redistribute it and/or modify it
+   under the terms of the GNU General Public License as published
+   by the Free Software Foundation; either version 3, or (at your
+   option) any later version.
+
+   GCC is distributed in the hope that it will be useful, but WITHOUT
+   ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+   or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public
+   License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with GCC; see the file COPYING3.  If not see
+   <http://www.gnu.org/licenses/>.  */
+
+#include "config.h"
+#include "system.h"
+#include "coretypes.h"
+#include "tm.h"
+#include "common/common-target.h"
+#include "common/common-target-def.h"
+
+/* 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 const struct default_options mcore_option_optimization_table[] =
+  {
+    { OPT_LEVELS_1_PLUS, OPT_ffunction_cse, NULL, 0 },
+    { OPT_LEVELS_1_PLUS, OPT_fomit_frame_pointer, NULL, 1 },
+    { OPT_LEVELS_ALL, OPT_fcaller_saves, NULL, 0 },
+    { OPT_LEVELS_ALL, OPT_fschedule_insns, NULL, 0 },
+    { OPT_LEVELS_ALL, OPT_fschedule_insns2, NULL, 0 },
+    { OPT_LEVELS_SIZE, OPT_mhardlit, NULL, 0 },
+    { OPT_LEVELS_NONE, 0, NULL, 0 }
+  };
+
+#undef  TARGET_DEFAULT_TARGET_FLAGS
+#define TARGET_DEFAULT_TARGET_FLAGS    TARGET_DEFAULT
+
+#undef TARGET_OPTION_OPTIMIZATION_TABLE
+#define TARGET_OPTION_OPTIMIZATION_TABLE mcore_option_optimization_table
+
+#undef TARGET_EXCEPT_UNWIND_INFO
+#define TARGET_EXCEPT_UNWIND_INFO sjlj_except_unwind_info
+
+struct gcc_targetm_common targetm_common = TARGETM_COMMON_INITIALIZER;
diff --git a/gcc/common/config/mep/mep-common.c b/gcc/common/config/mep/mep-common.c
new file mode 100644 (file)
index 0000000..d15e03b
--- /dev/null
@@ -0,0 +1,91 @@
+/* Common hooks for Toshiba Media Processor.
+   Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010,
+   2011
+   Free Software Foundation, Inc.
+
+This file is part of GCC.
+
+GCC is free software; you can redistribute it and/or modify it under
+the terms of the GNU General Public License as published by the Free
+Software Foundation; either version 3, or (at your option) any later
+version.
+
+GCC is distributed in the hope that it will be useful, but WITHOUT ANY
+WARRANTY; without even the implied warranty of MERCHANTABILITY or
+FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+for more details.
+
+You should have received a copy of the GNU General Public License
+along with GCC; see the file COPYING3.  If not see
+<http://www.gnu.org/licenses/>.  */
+
+#include "config.h"
+#include "system.h"
+#include "coretypes.h"
+#include "tm.h"
+#include "common/common-target.h"
+#include "common/common-target-def.h"
+#include "opts.h"
+#include "flags.h"
+
+static const struct default_options mep_option_optimization_table[] =
+  {
+    /* The first scheduling pass often increases register pressure and
+       tends to result in more spill code.  Only run it when
+       specifically asked.  */
+    { OPT_LEVELS_ALL, OPT_fschedule_insns, NULL, 0 },
+
+    /* Using $fp doesn't gain us much, even when debugging is
+       important.  */
+    { OPT_LEVELS_ALL, OPT_fomit_frame_pointer, NULL, 1 },
+
+    { OPT_LEVELS_NONE, 0, NULL, 0 }
+  };
+
+static bool
+mep_handle_option (struct gcc_options *opts,
+                  struct gcc_options *opts_set ATTRIBUTE_UNUSED,
+                  const struct cl_decoded_option *decoded,
+                  location_t loc ATTRIBUTE_UNUSED)
+{
+  size_t code = decoded->opt_index;
+
+  switch (code)
+    {
+    case OPT_mall_opts:
+      opts->x_target_flags |= MEP_ALL_OPTS;
+      break;
+
+    case OPT_mno_opts:
+      opts->x_target_flags &= ~ MEP_ALL_OPTS;
+      break;
+
+    case OPT_mcop64:
+      opts->x_target_flags |= MASK_COP;
+      opts->x_target_flags |= MASK_64BIT_CR_REGS;
+      break;
+
+    case OPT_mivc2:
+      opts->x_target_flags |= MASK_COP;
+      opts->x_target_flags |= MASK_64BIT_CR_REGS;
+      opts->x_target_flags |= MASK_VLIW;
+      opts->x_target_flags |= MASK_OPT_VL64;
+      opts->x_target_flags |= MASK_IVC2;
+
+      /* Remaining handling of this option deferred.  */
+      break;
+
+    default:
+      break;
+    }
+  return TRUE;
+}
+
+#undef  TARGET_HANDLE_OPTION
+#define TARGET_HANDLE_OPTION            mep_handle_option
+#undef  TARGET_OPTION_OPTIMIZATION_TABLE
+#define TARGET_OPTION_OPTIMIZATION_TABLE       mep_option_optimization_table
+#undef  TARGET_DEFAULT_TARGET_FLAGS
+#define TARGET_DEFAULT_TARGET_FLAGS    TARGET_DEFAULT
+
+struct gcc_targetm_common targetm_common = TARGETM_COMMON_INITIALIZER;
diff --git a/gcc/common/config/microblaze/microblaze-common.c b/gcc/common/config/microblaze/microblaze-common.c
new file mode 100644 (file)
index 0000000..4de1beb
--- /dev/null
@@ -0,0 +1,43 @@
+/* Common hooks for Xilinx MicroBlaze.
+   Copyright 2009, 2010, 2011 Free Software Foundation, Inc.
+
+   This file is part of GCC.
+
+   GCC is free software; you can redistribute it and/or modify it
+   under the terms of the GNU General Public License as published
+   by the Free Software Foundation; either version 3, or (at your
+   option) any later version.
+
+   GCC is distributed in the hope that it will be useful, but WITHOUT
+   ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+   or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public
+   License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with GCC; see the file COPYING3.  If not see
+   <http://www.gnu.org/licenses/>.  */
+
+#include "config.h"
+#include "system.h"
+#include "coretypes.h"
+#include "tm.h"
+#include "common/common-target.h"
+#include "common/common-target-def.h"
+
+/* Implement TARGET_OPTION_OPTIMIZATION_TABLE.  */
+static const struct default_options microblaze_option_optimization_table[] =
+  {
+    { OPT_LEVELS_1_PLUS, OPT_fomit_frame_pointer, NULL, 1 },
+    { OPT_LEVELS_NONE, 0, NULL, 0 }
+  };
+
+#undef TARGET_DEFAULT_TARGET_FLAGS
+#define TARGET_DEFAULT_TARGET_FLAGS    TARGET_DEFAULT
+
+#undef  TARGET_OPTION_OPTIMIZATION_TABLE
+#define TARGET_OPTION_OPTIMIZATION_TABLE microblaze_option_optimization_table
+
+#undef TARGET_EXCEPT_UNWIND_INFO
+#define TARGET_EXCEPT_UNWIND_INFO  sjlj_except_unwind_info
+
+struct gcc_targetm_common targetm_common = TARGETM_COMMON_INITIALIZER;
diff --git a/gcc/common/config/mips/mips-common.c b/gcc/common/config/mips/mips-common.c
new file mode 100644 (file)
index 0000000..53a326d
--- /dev/null
@@ -0,0 +1,74 @@
+/* Common hooks for MIPS.
+   Copyright (C) 1989, 1990, 1991, 1993, 1994, 1995, 1996, 1997, 1998,
+   1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010,
+   2011
+   Free Software Foundation, Inc.
+
+This file is part of GCC.
+
+GCC is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 3, or (at your option)
+any later version.
+
+GCC is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GCC; see the file COPYING3.  If not see
+<http://www.gnu.org/licenses/>.  */
+
+#include "config.h"
+#include "system.h"
+#include "coretypes.h"
+#include "tm.h"
+#include "common/common-target.h"
+#include "common/common-target-def.h"
+#include "opts.h"
+#include "flags.h"
+
+/* Implement TARGET_HANDLE_OPTION.  */
+
+static bool
+mips_handle_option (struct gcc_options *opts,
+                   struct gcc_options *opts_set ATTRIBUTE_UNUSED,
+                   const struct cl_decoded_option *decoded,
+                   location_t loc ATTRIBUTE_UNUSED)
+{
+  size_t code = decoded->opt_index;
+
+  switch (code)
+    {
+    case OPT_mno_flush_func:
+      opts->x_mips_cache_flush_func = NULL;
+      return true;
+
+    default:
+      return true;
+    }
+}
+
+/* Implement TARGET_OPTION_OPTIMIZATION_TABLE.  */
+static const struct default_options mips_option_optimization_table[] =
+  {
+    { OPT_LEVELS_1_PLUS, OPT_fomit_frame_pointer, NULL, 1 },
+    { OPT_LEVELS_NONE, 0, NULL, 0 }
+  };
+
+#undef TARGET_OPTION_OPTIMIZATION_TABLE
+#define TARGET_OPTION_OPTIMIZATION_TABLE mips_option_optimization_table
+
+#undef TARGET_DEFAULT_TARGET_FLAGS
+#define TARGET_DEFAULT_TARGET_FLAGS            \
+  (TARGET_DEFAULT                              \
+   | TARGET_CPU_DEFAULT                                \
+   | TARGET_ENDIAN_DEFAULT                     \
+   | TARGET_FP_EXCEPTIONS_DEFAULT              \
+   | MASK_CHECK_ZERO_DIV                       \
+   | MASK_FUSED_MADD)
+#undef TARGET_HANDLE_OPTION
+#define TARGET_HANDLE_OPTION mips_handle_option
+
+struct gcc_targetm_common targetm_common = TARGETM_COMMON_INITIALIZER;
diff --git a/gcc/common/config/mmix/mmix-common.c b/gcc/common/config/mmix/mmix-common.c
new file mode 100644 (file)
index 0000000..d73ca6d
--- /dev/null
@@ -0,0 +1,44 @@
+/* Common hooks for MMIX.
+   Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009,
+   2010, 2011
+   Free Software Foundation, Inc.
+
+This file is part of GCC.
+
+GCC is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 3, or (at your option)
+any later version.
+
+GCC is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GCC; see the file COPYING3.  If not see
+<http://www.gnu.org/licenses/>.  */
+
+#include "config.h"
+#include "system.h"
+#include "coretypes.h"
+#include "tm.h"
+#include "common/common-target.h"
+#include "common/common-target-def.h"
+
+/* TARGET_OPTION_OPTIMIZATION_TABLE.  */
+
+static const struct default_options mmix_option_optimization_table[] =
+  {
+    { OPT_LEVELS_1_PLUS, OPT_fregmove, NULL, 1 },
+    { OPT_LEVELS_2_PLUS, OPT_fomit_frame_pointer, NULL, 1 },
+    { OPT_LEVELS_NONE, 0, NULL, 0 }
+  };
+
+#undef TARGET_DEFAULT_TARGET_FLAGS
+#define TARGET_DEFAULT_TARGET_FLAGS TARGET_DEFAULT
+
+#undef TARGET_OPTION_OPTIMIZATION_TABLE
+#define TARGET_OPTION_OPTIMIZATION_TABLE mmix_option_optimization_table
+
+struct gcc_targetm_common targetm_common = TARGETM_COMMON_INITIALIZER;
diff --git a/gcc/common/config/mn10300/mn10300-common.c b/gcc/common/config/mn10300/mn10300-common.c
new file mode 100644 (file)
index 0000000..312f0eb
--- /dev/null
@@ -0,0 +1,79 @@
+/* Common hooks for Matsushita MN10300 series.
+   Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
+   2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software Foundation, Inc.
+
+   This file is part of GCC.
+
+   GCC is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3, or (at your option)
+   any later version.
+
+   GCC is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with GCC; see the file COPYING3.  If not see
+   <http://www.gnu.org/licenses/>.  */
+
+#include "config.h"
+#include "system.h"
+#include "coretypes.h"
+#include "tm.h"
+#include "common/common-target.h"
+#include "common/common-target-def.h"
+#include "opts.h"
+#include "flags.h"
+
+/* Implement TARGET_OPTION_OPTIMIZATION_TABLE.  */
+static const struct default_options mn10300_option_optimization_table[] =
+  {
+    { OPT_LEVELS_1_PLUS, OPT_fomit_frame_pointer, NULL, 1 },
+    { OPT_LEVELS_NONE, 0, NULL, 0 }
+  };
+
+/* Implement TARGET_HANDLE_OPTION.  */
+
+static bool
+mn10300_handle_option (struct gcc_options *opts,
+                      struct gcc_options *opts_set ATTRIBUTE_UNUSED,
+                      const struct cl_decoded_option *decoded,
+                      location_t loc ATTRIBUTE_UNUSED)
+{
+  size_t code = decoded->opt_index;
+  int value = decoded->value;
+
+  switch (code)
+    {
+    case OPT_mam33:
+      opts->x_mn10300_processor = value ? PROCESSOR_AM33 : PROCESSOR_MN10300;
+      return true;
+
+    case OPT_mam33_2:
+      opts->x_mn10300_processor = (value
+                                  ? PROCESSOR_AM33_2
+                                  : MIN (PROCESSOR_AM33, PROCESSOR_DEFAULT));
+      return true;
+
+    case OPT_mam34:
+      opts->x_mn10300_processor = (value ? PROCESSOR_AM34 : PROCESSOR_DEFAULT);
+      return true;
+
+    default:
+      return true;
+    }
+}
+
+#undef  TARGET_EXCEPT_UNWIND_INFO
+#define TARGET_EXCEPT_UNWIND_INFO sjlj_except_unwind_info
+
+#undef  TARGET_DEFAULT_TARGET_FLAGS
+#define TARGET_DEFAULT_TARGET_FLAGS MASK_MULT_BUG | MASK_PTR_A0D0 | MASK_ALLOW_LIW | MASK_ALLOW_SETLB
+#undef  TARGET_HANDLE_OPTION
+#define TARGET_HANDLE_OPTION mn10300_handle_option
+#undef  TARGET_OPTION_OPTIMIZATION_TABLE
+#define TARGET_OPTION_OPTIMIZATION_TABLE mn10300_option_optimization_table
+
+struct gcc_targetm_common targetm_common = TARGETM_COMMON_INITIALIZER;
index a14e9b124c7051d561eae66e74339fcba01f5107..faa54ac042f27b90f68fc438271a69b36aee91e8 100644 (file)
@@ -1,5 +1,6 @@
 /* HPPA common hooks.
-   Copyright (C) 2011
+   Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001,
+   2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011
    Free Software Foundation, Inc.
 
 This file is part of GCC.
@@ -21,8 +22,59 @@ along with GCC; see the file COPYING3.  If not see
 #include "config.h"
 #include "system.h"
 #include "coretypes.h"
+#include "tm.h"
 #include "common/common-target.h"
 #include "common/common-target-def.h"
-#include "tm.h"
+#include "opts.h"
+#include "flags.h"
+
+/* Implement TARGET_OPTION_OPTIMIZATION_TABLE.  */
+static const struct default_options pa_option_optimization_table[] =
+  {
+    { OPT_LEVELS_1_PLUS, OPT_fomit_frame_pointer, NULL, 1 },
+    { OPT_LEVELS_NONE, 0, NULL, 0 }
+  };
+
+/* Implement TARGET_HANDLE_OPTION.  */
+
+static bool
+pa_handle_option (struct gcc_options *opts,
+                 struct gcc_options *opts_set ATTRIBUTE_UNUSED,
+                 const struct cl_decoded_option *decoded,
+                 location_t loc ATTRIBUTE_UNUSED)
+{
+  size_t code = decoded->opt_index;
+
+  switch (code)
+    {
+    case OPT_mnosnake:
+    case OPT_mpa_risc_1_0:
+    case OPT_march_1_0:
+      opts->x_target_flags &= ~(MASK_PA_11 | MASK_PA_20);
+      return true;
+
+    case OPT_msnake:
+    case OPT_mpa_risc_1_1:
+    case OPT_march_1_1:
+      opts->x_target_flags &= ~MASK_PA_20;
+      opts->x_target_flags |= MASK_PA_11;
+      return true;
+
+    case OPT_mpa_risc_2_0:
+    case OPT_march_2_0:
+      opts->x_target_flags |= MASK_PA_11 | MASK_PA_20;
+      return true;
+
+    default:
+      return true;
+    }
+}
+
+#undef TARGET_OPTION_OPTIMIZATION_TABLE
+#define TARGET_OPTION_OPTIMIZATION_TABLE pa_option_optimization_table
+#undef TARGET_DEFAULT_TARGET_FLAGS
+#define TARGET_DEFAULT_TARGET_FLAGS (TARGET_DEFAULT | TARGET_CPU_DEFAULT)
+#undef TARGET_HANDLE_OPTION
+#define TARGET_HANDLE_OPTION pa_handle_option
 
 struct gcc_targetm_common targetm_common = TARGETM_COMMON_INITIALIZER;
diff --git a/gcc/common/config/pdp11/pdp11-common.c b/gcc/common/config/pdp11/pdp11-common.c
new file mode 100644 (file)
index 0000000..a288a8e
--- /dev/null
@@ -0,0 +1,79 @@
+/* Common hooks for pdp11.
+   Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2001, 2004, 2005,
+   2006, 2007, 2008, 2009, 2010, 2011 Free Software Foundation, Inc.
+
+This file is part of GCC.
+
+GCC is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 3, or (at your option)
+any later version.
+
+GCC is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GCC; see the file COPYING3.  If not see
+<http://www.gnu.org/licenses/>.  */
+
+#include "config.h"
+#include "system.h"
+#include "coretypes.h"
+#include "tm.h"
+#include "common/common-target.h"
+#include "common/common-target-def.h"
+#include "opts.h"
+#include "flags.h"
+
+/* Implement TARGET_OPTION_OPTIMIZATION_TABLE.  */
+
+static const struct default_options pdp11_option_optimization_table[] =
+  {
+    { OPT_LEVELS_3_PLUS, OPT_fomit_frame_pointer, NULL, 1 },
+    { OPT_LEVELS_NONE, 0, NULL, 0 }
+  };
+
+/* Implement TARGET_HANDLE_OPTION.  */
+
+static bool
+pdp11_handle_option (struct gcc_options *opts,
+                    struct gcc_options *opts_set ATTRIBUTE_UNUSED,
+                    const struct cl_decoded_option *decoded,
+                    location_t loc ATTRIBUTE_UNUSED)
+{
+  size_t code = decoded->opt_index;
+
+  switch (code)
+    {
+    case OPT_m10:
+      opts->x_target_flags &= ~(MASK_40 | MASK_45);
+      return true;
+
+    default:
+      return true;
+    }
+}
+
+/* Implement TARGET_OPTION_INIT_STRUCT.  */
+
+static void
+pdp11_option_init_struct (struct gcc_options *opts)
+{
+  opts->x_flag_finite_math_only = 0;
+  opts->x_flag_trapping_math = 0;
+  opts->x_flag_signaling_nans = 0;
+}
+
+#undef TARGET_DEFAULT_TARGET_FLAGS
+#define TARGET_DEFAULT_TARGET_FLAGS \
+  (MASK_FPU | MASK_45 | TARGET_UNIX_ASM_DEFAULT)
+#undef TARGET_HANDLE_OPTION
+#define TARGET_HANDLE_OPTION pdp11_handle_option
+#undef TARGET_OPTION_OPTIMIZATION_TABLE
+#define TARGET_OPTION_OPTIMIZATION_TABLE pdp11_option_optimization_table
+#undef TARGET_OPTION_INIT_STRUCT
+#define TARGET_OPTION_INIT_STRUCT pdp11_option_init_struct
+
+struct gcc_targetm_common targetm_common = TARGETM_COMMON_INITIALIZER;
diff --git a/gcc/common/config/picochip/picochip-common.c b/gcc/common/config/picochip/picochip-common.c
new file mode 100644 (file)
index 0000000..286ee45
--- /dev/null
@@ -0,0 +1,43 @@
+/* Common hooks for picoChip.
+   Copyright (C) 2001, 2008, 2009, 2010, 2011 Free Software Foundation, Inc.
+
+This file is part of GCC.
+
+GCC is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 3, or (at your option)
+any later version.
+
+GCC is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GCC; see the file COPYING3.  If not, see
+<http://www.gnu.org/licenses/>. */
+
+#include "config.h"
+#include "system.h"
+#include "coretypes.h"
+#include "tm.h"
+#include "common/common-target.h"
+#include "common/common-target-def.h"
+
+/* Implement TARGET_OPTION_OPTIMIZATION_TABLE.  */
+static const struct default_options picochip_option_optimization_table[] =
+  {
+    { OPT_LEVELS_1_PLUS, OPT_fomit_frame_pointer, NULL, 1 },
+    { OPT_LEVELS_NONE, 0, NULL, 0 }
+  };
+
+#undef TARGET_HAVE_NAMED_SECTIONS
+#define TARGET_HAVE_NAMED_SECTIONS 1
+
+#undef TARGET_OPTION_OPTIMIZATION_TABLE
+#define TARGET_OPTION_OPTIMIZATION_TABLE picochip_option_optimization_table
+
+#undef TARGET_EXCEPT_UNWIND_INFO
+#define TARGET_EXCEPT_UNWIND_INFO sjlj_except_unwind_info
+
+struct gcc_targetm_common targetm_common = TARGETM_COMMON_INITIALIZER;
diff --git a/gcc/common/config/rs6000/rs6000-common.c b/gcc/common/config/rs6000/rs6000-common.c
new file mode 100644 (file)
index 0000000..0482c07
--- /dev/null
@@ -0,0 +1,326 @@
+/* Common hooks for IBM RS/6000.
+   Copyright (C) 1991, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
+   2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011
+   Free Software Foundation, Inc.
+
+   This file is part of GCC.
+
+   GCC is free software; you can redistribute it and/or modify it
+   under the terms of the GNU General Public License as published
+   by the Free Software Foundation; either version 3, or (at your
+   option) any later version.
+
+   GCC is distributed in the hope that it will be useful, but WITHOUT
+   ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+   or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public
+   License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with GCC; see the file COPYING3.  If not see
+   <http://www.gnu.org/licenses/>.  */
+
+#include "config.h"
+#include "system.h"
+#include "coretypes.h"
+#include "diagnostic-core.h"
+#include "tm.h"
+#include "common/common-target.h"
+#include "common/common-target-def.h"
+#include "opts.h"
+#include "flags.h"
+
+/* Implement TARGET_OPTION_OPTIMIZATION_TABLE.  */
+static const struct default_options rs6000_option_optimization_table[] =
+  {
+    { OPT_LEVELS_1_PLUS, OPT_fomit_frame_pointer, NULL, 1 },
+    { OPT_LEVELS_NONE, 0, NULL, 0 }
+  };
+
+/* Implement TARGET_OPTION_INIT_STRUCT.  */
+
+static void
+rs6000_option_init_struct (struct gcc_options *opts)
+{
+  if (DEFAULT_ABI == ABI_DARWIN)
+    /* The Darwin libraries never set errno, so we might as well
+       avoid calling them when that's the only reason we would.  */
+    opts->x_flag_errno_math = 0;
+
+  /* Enable section anchors by default.  */
+  if (!TARGET_MACHO)
+    opts->x_flag_section_anchors = 1;
+}
+
+/* If not otherwise specified by a target, make 'long double' equivalent to
+   'double'.  */
+
+#ifndef RS6000_DEFAULT_LONG_DOUBLE_SIZE
+#define RS6000_DEFAULT_LONG_DOUBLE_SIZE 64
+#endif
+
+/* Implement TARGET_HANDLE_OPTION.  */
+
+static bool
+rs6000_handle_option (struct gcc_options *opts, struct gcc_options *opts_set,
+                     const struct cl_decoded_option *decoded,
+                     location_t loc)
+{
+  enum fpu_type_t fpu_type = FPU_NONE;
+  char *p, *q;
+  size_t code = decoded->opt_index;
+  const char *arg = decoded->arg;
+  int value = decoded->value;
+
+  switch (code)
+    {
+    case OPT_mno_power:
+      opts->x_target_flags &= ~(MASK_POWER | MASK_POWER2
+                               | MASK_MULTIPLE | MASK_STRING);
+      opts_set->x_target_flags |= (MASK_POWER | MASK_POWER2
+                                  | MASK_MULTIPLE | MASK_STRING);
+      break;
+    case OPT_mno_powerpc:
+      opts->x_target_flags &= ~(MASK_POWERPC | MASK_PPC_GPOPT
+                               | MASK_PPC_GFXOPT | MASK_POWERPC64);
+      opts_set->x_target_flags |= (MASK_POWERPC | MASK_PPC_GPOPT
+                                  | MASK_PPC_GFXOPT | MASK_POWERPC64);
+      break;
+    case OPT_mfull_toc:
+      opts->x_target_flags &= ~MASK_MINIMAL_TOC;
+      opts->x_TARGET_NO_FP_IN_TOC = 0;
+      opts->x_TARGET_NO_SUM_IN_TOC = 0;
+      opts_set->x_target_flags |= MASK_MINIMAL_TOC;
+#ifdef TARGET_USES_SYSV4_OPT
+      /* Note, V.4 no longer uses a normal TOC, so make -mfull-toc, be
+        just the same as -mminimal-toc.  */
+      opts->x_target_flags |= MASK_MINIMAL_TOC;
+      opts_set->x_target_flags |= MASK_MINIMAL_TOC;
+#endif
+      break;
+
+#ifdef TARGET_USES_SYSV4_OPT
+    case OPT_mtoc:
+      /* Make -mtoc behave like -mminimal-toc.  */
+      opts->x_target_flags |= MASK_MINIMAL_TOC;
+      opts_set->x_target_flags |= MASK_MINIMAL_TOC;
+      break;
+#endif
+
+#ifdef TARGET_USES_AIX64_OPT
+    case OPT_maix64:
+#else
+    case OPT_m64:
+#endif
+      opts->x_target_flags |= MASK_POWERPC64 | MASK_POWERPC;
+      opts->x_target_flags |= ~opts_set->x_target_flags & MASK_PPC_GFXOPT;
+      opts_set->x_target_flags |= MASK_POWERPC64 | MASK_POWERPC;
+      break;
+
+#ifdef TARGET_USES_AIX64_OPT
+    case OPT_maix32:
+#else
+    case OPT_m32:
+#endif
+      opts->x_target_flags &= ~MASK_POWERPC64;
+      opts_set->x_target_flags |= MASK_POWERPC64;
+      break;
+
+    case OPT_mminimal_toc:
+      if (value == 1)
+       {
+         opts->x_TARGET_NO_FP_IN_TOC = 0;
+         opts->x_TARGET_NO_SUM_IN_TOC = 0;
+       }
+      break;
+
+    case OPT_mpower:
+      if (value == 1)
+       {
+         opts->x_target_flags |= (MASK_MULTIPLE | MASK_STRING);
+         opts_set->x_target_flags |= (MASK_MULTIPLE | MASK_STRING);
+       }
+      break;
+
+    case OPT_mpower2:
+      if (value == 1)
+       {
+         opts->x_target_flags |= (MASK_POWER | MASK_MULTIPLE | MASK_STRING);
+         opts_set->x_target_flags |= (MASK_POWER
+                                      | MASK_MULTIPLE
+                                      | MASK_STRING);
+       }
+      break;
+
+    case OPT_mpowerpc_gpopt:
+    case OPT_mpowerpc_gfxopt:
+      if (value == 1)
+       {
+         opts->x_target_flags |= MASK_POWERPC;
+         opts_set->x_target_flags |= MASK_POWERPC;
+       }
+      break;
+
+    case OPT_mdebug_:
+      p = ASTRDUP (arg);
+      opts->x_rs6000_debug = 0;
+
+      while ((q = strtok (p, ",")) != NULL)
+       {
+         unsigned mask = 0;
+         bool invert;
+
+         p = NULL;
+         if (*q == '!')
+           {
+             invert = true;
+             q++;
+           }
+         else
+           invert = false;
+
+         if (! strcmp (q, "all"))
+           mask = MASK_DEBUG_ALL;
+         else if (! strcmp (q, "stack"))
+           mask = MASK_DEBUG_STACK;
+         else if (! strcmp (q, "arg"))
+           mask = MASK_DEBUG_ARG;
+         else if (! strcmp (q, "reg"))
+           mask = MASK_DEBUG_REG;
+         else if (! strcmp (q, "addr"))
+           mask = MASK_DEBUG_ADDR;
+         else if (! strcmp (q, "cost"))
+           mask = MASK_DEBUG_COST;
+         else if (! strcmp (q, "target"))
+           mask = MASK_DEBUG_TARGET;
+         else
+           error_at (loc, "unknown -mdebug-%s switch", q);
+
+         if (invert)
+           opts->x_rs6000_debug &= ~mask;
+         else  
+           opts->x_rs6000_debug |= mask;
+       }
+      break;
+
+#ifdef TARGET_USES_SYSV4_OPT
+    case OPT_mrelocatable:
+      if (value == 1)
+       {
+         opts->x_target_flags |= MASK_MINIMAL_TOC;
+         opts_set->x_target_flags |= MASK_MINIMAL_TOC;
+         opts->x_TARGET_NO_FP_IN_TOC = 1;
+       }
+      break;
+
+    case OPT_mrelocatable_lib:
+      if (value == 1)
+       {
+         opts->x_target_flags |= MASK_RELOCATABLE | MASK_MINIMAL_TOC;
+         opts_set->x_target_flags |= MASK_RELOCATABLE | MASK_MINIMAL_TOC;
+         opts->x_TARGET_NO_FP_IN_TOC = 1;
+       }
+      else
+       {
+         opts->x_target_flags &= ~MASK_RELOCATABLE;
+         opts_set->x_target_flags |= MASK_RELOCATABLE;
+       }
+      break;
+#endif
+
+    case OPT_mabi_altivec:
+      /* Enabling the AltiVec ABI turns off the SPE ABI.  */
+      opts->x_rs6000_spe_abi = 0;
+      break;
+
+    case OPT_mabi_spe:
+      opts->x_rs6000_altivec_abi = 0;
+      break;
+
+    case OPT_mlong_double_:
+      if (value != 64 && value != 128)
+       {
+         error_at (loc, "unknown switch -mlong-double-%s", arg);
+         opts->x_rs6000_long_double_type_size
+           = RS6000_DEFAULT_LONG_DOUBLE_SIZE;
+         return false;
+       }
+      break;
+
+    case OPT_msingle_float:
+      if (!TARGET_SINGLE_FPU) 
+       warning_at (loc, 0,
+                   "-msingle-float option equivalent to -mhard-float");
+      /* -msingle-float implies -mno-double-float and TARGET_HARD_FLOAT. */
+      opts->x_rs6000_double_float = 0;
+      opts->x_target_flags &= ~MASK_SOFT_FLOAT;
+      opts_set->x_target_flags |= MASK_SOFT_FLOAT;
+      break;
+
+    case OPT_mdouble_float:
+      /* -mdouble-float implies -msingle-float and TARGET_HARD_FLOAT. */
+      opts->x_rs6000_single_float = 1;
+      opts->x_target_flags &= ~MASK_SOFT_FLOAT;
+      opts_set->x_target_flags |= MASK_SOFT_FLOAT;
+      break;
+
+    case OPT_msimple_fpu:
+      if (!TARGET_SINGLE_FPU) 
+       warning_at (loc, 0, "-msimple-fpu option ignored");
+      break;
+
+    case OPT_mhard_float:
+      /* -mhard_float implies -msingle-float and -mdouble-float. */
+      opts->x_rs6000_single_float = opts->x_rs6000_double_float = 1;
+      break;
+
+    case OPT_msoft_float:
+      /* -msoft_float implies -mnosingle-float and -mnodouble-float. */
+      opts->x_rs6000_single_float = opts->x_rs6000_double_float = 0;
+      break;
+
+    case OPT_mfpu_:
+      fpu_type = (enum fpu_type_t) value;
+      if (fpu_type != FPU_NONE)
+       {
+         /* If -mfpu is not none, then turn off SOFT_FLOAT, turn on
+            HARD_FLOAT. */
+         opts->x_target_flags &= ~MASK_SOFT_FLOAT;
+         opts_set->x_target_flags |= MASK_SOFT_FLOAT;
+         opts->x_rs6000_xilinx_fpu = 1;
+         if (fpu_type == FPU_SF_LITE || fpu_type == FPU_SF_FULL) 
+           opts->x_rs6000_single_float = 1;
+         if (fpu_type == FPU_DF_LITE || fpu_type == FPU_DF_FULL) 
+           opts->x_rs6000_single_float = opts->x_rs6000_double_float = 1;
+         if (fpu_type == FPU_SF_LITE || fpu_type == FPU_DF_LITE) 
+           opts->x_rs6000_simple_fpu = 1;
+       }
+      else
+       {
+         /* -mfpu=none is equivalent to -msoft-float.  */
+         opts->x_target_flags |= MASK_SOFT_FLOAT;
+         opts_set->x_target_flags |= MASK_SOFT_FLOAT;
+         opts->x_rs6000_single_float = opts->x_rs6000_double_float = 0;
+       }
+      break;
+
+    case OPT_mrecip:
+      opts->x_rs6000_recip_name = (value) ? "default" : "none";
+      break;
+    }
+  return true;
+}
+
+#undef TARGET_HANDLE_OPTION
+#define TARGET_HANDLE_OPTION rs6000_handle_option
+
+#undef TARGET_OPTION_INIT_STRUCT
+#define TARGET_OPTION_INIT_STRUCT rs6000_option_init_struct
+
+#undef TARGET_OPTION_OPTIMIZATION_TABLE
+#define TARGET_OPTION_OPTIMIZATION_TABLE rs6000_option_optimization_table
+
+#undef TARGET_DEFAULT_TARGET_FLAGS
+#define TARGET_DEFAULT_TARGET_FLAGS \
+  (TARGET_DEFAULT)
+
+struct gcc_targetm_common targetm_common = TARGETM_COMMON_INITIALIZER;
diff --git a/gcc/common/config/rx/rx-common.c b/gcc/common/config/rx/rx-common.c
new file mode 100644 (file)
index 0000000..259f9bb
--- /dev/null
@@ -0,0 +1,86 @@
+/* Common hooks for Renesas RX.
+   Copyright (C) 2008, 2009, 2010, 2011 Free Software Foundation, Inc.
+
+   This file is part of GCC.
+
+   GCC is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3, or (at your option)
+   any later version.
+
+   GCC is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with GCC; see the file COPYING3.  If not see
+   <http://www.gnu.org/licenses/>.  */
+
+#include "config.h"
+#include "system.h"
+#include "coretypes.h"
+#include "diagnostic-core.h"
+#include "tm.h"
+#include "common/common-target.h"
+#include "common/common-target-def.h"
+#include "opts.h"
+#include "flags.h"
+
+/* Extra processing for target specific command line options.  */
+
+static bool
+rx_handle_option (struct gcc_options *opts,
+                 struct gcc_options *opts_set ATTRIBUTE_UNUSED,
+                 const struct cl_decoded_option *decoded,
+                 location_t loc)
+{
+  size_t code = decoded->opt_index;
+  int value = decoded->value;
+
+  switch (code)
+    {
+    case OPT_mint_register_:
+      /* Make sure that the -mint-register option is in range.  Other
+        handling in rx_option_override.  */
+      return value >= 0 && value <= 4;
+      break;
+
+    case OPT_mmax_constant_size_:
+      /* Make sure that the -mmax-constant_size option is in range.  */
+      return value >= 0 && value <= 4;
+
+    case OPT_mcpu_:
+      if ((enum rx_cpu_types) value == RX200)
+       opts->x_target_flags |= MASK_NO_USE_FPU;
+      break;
+      
+    case OPT_fpu:
+      if (opts->x_rx_cpu_type == RX200)
+       error_at (loc, "the RX200 cpu does not have FPU hardware");
+      break;
+
+    default:
+      break;
+    }
+
+  return true;
+}
+
+/* Implement TARGET_OPTION_OPTIMIZATION_TABLE.  */
+static const struct default_options rx_option_optimization_table[] =
+  {
+    { OPT_LEVELS_1_PLUS, OPT_fomit_frame_pointer, NULL, 1 },
+    { OPT_LEVELS_NONE, 0, NULL, 0 }
+  };
+
+#undef  TARGET_HANDLE_OPTION
+#define TARGET_HANDLE_OPTION                   rx_handle_option
+
+#undef  TARGET_OPTION_OPTIMIZATION_TABLE
+#define TARGET_OPTION_OPTIMIZATION_TABLE       rx_option_optimization_table
+
+#undef  TARGET_EXCEPT_UNWIND_INFO
+#define TARGET_EXCEPT_UNWIND_INFO              sjlj_except_unwind_info
+
+struct gcc_targetm_common targetm_common = TARGETM_COMMON_INITIALIZER;
diff --git a/gcc/common/config/s390/s390-common.c b/gcc/common/config/s390/s390-common.c
new file mode 100644 (file)
index 0000000..98b5c28
--- /dev/null
@@ -0,0 +1,127 @@
+/* Common hooks for IBM S/390 and zSeries.
+   Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006,
+   2007, 2008, 2009, 2010, 2011 Free Software Foundation, Inc.
+
+This file is part of GCC.
+
+GCC is free software; you can redistribute it and/or modify it under
+the terms of the GNU General Public License as published by the Free
+Software Foundation; either version 3, or (at your option) any later
+version.
+
+GCC is distributed in the hope that it will be useful, but WITHOUT ANY
+WARRANTY; without even the implied warranty of MERCHANTABILITY or
+FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+for more details.
+
+You should have received a copy of the GNU General Public License
+along with GCC; see the file COPYING3.  If not see
+<http://www.gnu.org/licenses/>.  */
+
+#include "config.h"
+#include "system.h"
+#include "coretypes.h"
+#include "diagnostic-core.h"
+#include "tm.h"
+#include "common/common-target.h"
+#include "common/common-target-def.h"
+#include "opts.h"
+#include "flags.h"
+
+EXPORTED_CONST int processor_flags_table[] =
+  {
+    /* g5 */     PF_IEEE_FLOAT,
+    /* g6 */     PF_IEEE_FLOAT,
+    /* z900 */   PF_IEEE_FLOAT | PF_ZARCH,
+    /* z990 */   PF_IEEE_FLOAT | PF_ZARCH | PF_LONG_DISPLACEMENT,
+    /* z9-109 */ PF_IEEE_FLOAT | PF_ZARCH | PF_LONG_DISPLACEMENT
+                 | PF_EXTIMM,
+    /* z9-ec */  PF_IEEE_FLOAT | PF_ZARCH | PF_LONG_DISPLACEMENT
+                 | PF_EXTIMM | PF_DFP,
+    /* z10 */    PF_IEEE_FLOAT | PF_ZARCH | PF_LONG_DISPLACEMENT
+                 | PF_EXTIMM | PF_DFP | PF_Z10,
+    /* z196 */   PF_IEEE_FLOAT | PF_ZARCH | PF_LONG_DISPLACEMENT
+                 | PF_EXTIMM | PF_DFP | PF_Z10 | PF_Z196
+  };
+
+/* Change optimizations to be performed, depending on the
+   optimization level.  */
+
+static const struct default_options s390_option_optimization_table[] =
+  {
+    { OPT_LEVELS_1_PLUS, OPT_fomit_frame_pointer, NULL, 1 },
+
+    /* ??? There are apparently still problems with -fcaller-saves.  */
+    { OPT_LEVELS_ALL, OPT_fcaller_saves, NULL, 0 },
+
+    /* Use MVCLE instructions to decrease code size if requested.  */
+    { OPT_LEVELS_SIZE, OPT_mmvcle, NULL, 1 },
+
+    { OPT_LEVELS_NONE, 0, NULL, 0 }
+  };
+
+/* Implement TARGET_OPTION_INIT_STRUCT.  */
+
+static void
+s390_option_init_struct (struct gcc_options *opts)
+{
+  /* By default, always emit DWARF-2 unwind info.  This allows debugging
+     without maintaining a stack frame back-chain.  */
+  opts->x_flag_asynchronous_unwind_tables = 1;
+}
+
+/* Implement TARGET_HANDLE_OPTION.  */
+
+static bool
+s390_handle_option (struct gcc_options *opts,
+                   struct gcc_options *opts_set ATTRIBUTE_UNUSED,
+                   const struct cl_decoded_option *decoded,
+                   location_t loc)
+{
+  size_t code = decoded->opt_index;
+  const char *arg = decoded->arg;
+  int value = decoded->value;
+
+  switch (code)
+    {
+    case OPT_march_:
+      opts->x_s390_arch_flags = processor_flags_table[value];
+      opts->x_s390_arch_string = arg;
+      return true;
+
+    case OPT_mstack_guard_:
+      if (exact_log2 (value) == -1)
+       error_at (loc, "stack guard value must be an exact power of 2");
+      return true;
+
+    case OPT_mstack_size_:
+      if (exact_log2 (value) == -1)
+       error_at (loc, "stack size must be an exact power of 2");
+      return true;
+
+    case OPT_mtune_:
+      opts->x_s390_tune_flags = processor_flags_table[value];
+      return true;
+
+    case OPT_mwarn_framesize_:
+      return sscanf (arg, HOST_WIDE_INT_PRINT_DEC,
+                    &opts->x_s390_warn_framesize) == 1;
+
+    default:
+      return true;
+    }
+}
+
+#undef TARGET_DEFAULT_TARGET_FLAGS
+#define TARGET_DEFAULT_TARGET_FLAGS (TARGET_DEFAULT)
+
+#undef TARGET_HANDLE_OPTION
+#define TARGET_HANDLE_OPTION s390_handle_option
+
+#undef TARGET_OPTION_OPTIMIZATION_TABLE
+#define TARGET_OPTION_OPTIMIZATION_TABLE s390_option_optimization_table
+
+#undef TARGET_OPTION_INIT_STRUCT
+#define TARGET_OPTION_INIT_STRUCT s390_option_init_struct
+
+struct gcc_targetm_common targetm_common = TARGETM_COMMON_INITIALIZER;
diff --git a/gcc/common/config/score/score-common.c b/gcc/common/config/score/score-common.c
new file mode 100644 (file)
index 0000000..756e5b3
--- /dev/null
@@ -0,0 +1,75 @@
+/* Common hooks for Sunplus S+CORE.
+   Copyright (C) 2005, 2007, 2008, 2009, 2010, 2011
+   Free Software Foundation, Inc.
+
+   This file is part of GCC.
+
+   GCC is free software; you can redistribute it and/or modify it
+   under the terms of the GNU General Public License as published
+   by the Free Software Foundation; either version 3, or (at your
+   option) any later version.
+
+   GCC is distributed in the hope that it will be useful, but WITHOUT
+   ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+   or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public
+   License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with GCC; see the file COPYING3.  If not see
+   <http://www.gnu.org/licenses/>.  */
+
+#include "config.h"
+#include "system.h"
+#include "coretypes.h"
+#include "tm.h"
+#include "common/common-target.h"
+#include "common/common-target-def.h"
+#include "opts.h"
+#include "flags.h"
+
+/* Implement TARGET_OPTION_OPTIMIZATION_TABLE.  */
+static const struct default_options score_option_optimization_table[] =
+  {
+    { OPT_LEVELS_1_PLUS, OPT_fomit_frame_pointer, NULL, 1 },
+    { OPT_LEVELS_NONE, 0, NULL, 0 }
+  };
+
+#undef TARGET_DEFAULT_TARGET_FLAGS
+#define TARGET_DEFAULT_TARGET_FLAGS     TARGET_DEFAULT
+
+#undef TARGET_HANDLE_OPTION
+#define TARGET_HANDLE_OPTION            score_handle_option
+
+#undef TARGET_OPTION_OPTIMIZATION_TABLE
+#define TARGET_OPTION_OPTIMIZATION_TABLE score_option_optimization_table
+
+#define MASK_ALL_CPU_BITS      (MASK_SCORE7 | MASK_SCORE7D)
+
+/* Implement TARGET_HANDLE_OPTION.  */
+static bool
+score_handle_option (struct gcc_options *opts,
+                    struct gcc_options *opts_set ATTRIBUTE_UNUSED,
+                    const struct cl_decoded_option *decoded,
+                    location_t loc ATTRIBUTE_UNUSED)
+{
+  size_t code = decoded->opt_index;
+  int value = decoded->value;
+
+  switch (code)
+    {
+    case OPT_mscore7d:
+      opts->x_target_flags &= ~(MASK_ALL_CPU_BITS);
+      opts->x_target_flags |= MASK_SCORE7 | MASK_SCORE7D;
+      return true;
+
+    case OPT_march_:
+      opts->x_target_flags &= ~(MASK_ALL_CPU_BITS);
+      opts->x_target_flags |= value;
+      return true;
+
+    default:
+      return true;
+    }
+}
+
+struct gcc_targetm_common targetm_common = TARGETM_COMMON_INITIALIZER;
diff --git a/gcc/common/config/sh/sh-common.c b/gcc/common/config/sh/sh-common.c
new file mode 100644 (file)
index 0000000..8677fd4
--- /dev/null
@@ -0,0 +1,208 @@
+/* Common hooks for Renesas / SuperH SH.
+   Copyright (C) 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+   2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011
+   Free Software Foundation, Inc.
+
+This file is part of GCC.
+
+GCC is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 3, or (at your option)
+any later version.
+
+GCC is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GCC; see the file COPYING3.  If not see
+<http://www.gnu.org/licenses/>.  */
+
+#include "config.h"
+#include "system.h"
+#include "coretypes.h"
+#include "tm.h"
+#include "common/common-target.h"
+#include "common/common-target-def.h"
+#include "opts.h"
+#include "flags.h"
+
+/* Set default optimization options.  */
+static const struct default_options sh_option_optimization_table[] =
+  {
+    { OPT_LEVELS_1_PLUS, OPT_fomit_frame_pointer, NULL, 1 },
+    { OPT_LEVELS_1_PLUS_SPEED_ONLY, OPT_mdiv_, "inv:minlat", 1 },
+    { OPT_LEVELS_SIZE, OPT_mdiv_, SH_DIV_STR_FOR_SIZE, 1 },
+    { OPT_LEVELS_0_ONLY, OPT_mdiv_, "", 1 },
+    { OPT_LEVELS_SIZE, OPT_mcbranchdi, NULL, 0 },
+    /* We can't meaningfully test TARGET_SHMEDIA here, because -m
+       options haven't been parsed yet, hence we'd read only the
+       default.  sh_target_reg_class will return NO_REGS if this is
+       not SHMEDIA, so it's OK to always set
+       flag_branch_target_load_optimize.  */
+    { OPT_LEVELS_2_PLUS, OPT_fbranch_target_load_optimize, NULL, 1 },
+    { OPT_LEVELS_NONE, 0, NULL, 0 }
+  };
+
+/* Implement TARGET_HANDLE_OPTION.  */
+
+static bool
+sh_handle_option (struct gcc_options *opts,
+                 struct gcc_options *opts_set ATTRIBUTE_UNUSED,
+                 const struct cl_decoded_option *decoded,
+                 location_t loc ATTRIBUTE_UNUSED)
+{
+  size_t code = decoded->opt_index;
+
+  switch (code)
+    {
+    case OPT_m1:
+      opts->x_target_flags = (opts->x_target_flags & ~MASK_ARCH) | SELECT_SH1;
+      return true;
+
+    case OPT_m2:
+      opts->x_target_flags = (opts->x_target_flags & ~MASK_ARCH) | SELECT_SH2;
+      return true;
+
+    case OPT_m2a:
+      opts->x_target_flags = (opts->x_target_flags & ~MASK_ARCH) | SELECT_SH2A;
+      return true;
+
+    case OPT_m2a_nofpu:
+      opts->x_target_flags
+       = (opts->x_target_flags & ~MASK_ARCH) | SELECT_SH2A_NOFPU;
+      return true;
+
+    case OPT_m2a_single:
+      opts->x_target_flags
+       = (opts->x_target_flags & ~MASK_ARCH) | SELECT_SH2A_SINGLE;
+      return true;
+
+    case OPT_m2a_single_only:
+      opts->x_target_flags
+       = (opts->x_target_flags & ~MASK_ARCH) | SELECT_SH2A_SINGLE_ONLY;
+      return true;
+
+    case OPT_m2e:
+      opts->x_target_flags = (opts->x_target_flags & ~MASK_ARCH) | SELECT_SH2E;
+      return true;
+
+    case OPT_m3:
+      opts->x_target_flags = (opts->x_target_flags & ~MASK_ARCH) | SELECT_SH3;
+      return true;
+
+    case OPT_m3e:
+      opts->x_target_flags = (opts->x_target_flags & ~MASK_ARCH) | SELECT_SH3E;
+      return true;
+
+    case OPT_m4:
+    case OPT_m4_100:
+    case OPT_m4_200:
+    case OPT_m4_300:
+      opts->x_target_flags = (opts->x_target_flags & ~MASK_ARCH) | SELECT_SH4;
+      return true;
+
+    case OPT_m4_nofpu:
+    case OPT_m4_100_nofpu:
+    case OPT_m4_200_nofpu:
+    case OPT_m4_300_nofpu:
+    case OPT_m4_340:
+    case OPT_m4_400:
+    case OPT_m4_500:
+      opts->x_target_flags
+       = (opts->x_target_flags & ~MASK_ARCH) | SELECT_SH4_NOFPU;
+      return true;
+
+    case OPT_m4_single:
+    case OPT_m4_100_single:
+    case OPT_m4_200_single:
+    case OPT_m4_300_single:
+      opts->x_target_flags
+       = (opts->x_target_flags & ~MASK_ARCH) | SELECT_SH4_SINGLE;
+      return true;
+
+    case OPT_m4_single_only:
+    case OPT_m4_100_single_only:
+    case OPT_m4_200_single_only:
+    case OPT_m4_300_single_only:
+      opts->x_target_flags
+       = (opts->x_target_flags & ~MASK_ARCH) | SELECT_SH4_SINGLE_ONLY;
+      return true;
+
+    case OPT_m4a:
+      opts->x_target_flags = (opts->x_target_flags & ~MASK_ARCH) | SELECT_SH4A;
+      return true;
+
+    case OPT_m4a_nofpu:
+    case OPT_m4al:
+      opts->x_target_flags
+       = (opts->x_target_flags & ~MASK_ARCH) | SELECT_SH4A_NOFPU;
+      return true;
+
+    case OPT_m4a_single:
+      opts->x_target_flags
+       = (opts->x_target_flags & ~MASK_ARCH) | SELECT_SH4A_SINGLE;
+      return true;
+
+    case OPT_m4a_single_only:
+      opts->x_target_flags
+       = (opts->x_target_flags & ~MASK_ARCH) | SELECT_SH4A_SINGLE_ONLY;
+      return true;
+
+    case OPT_m5_32media:
+      opts->x_target_flags
+       = (opts->x_target_flags & ~MASK_ARCH) | SELECT_SH5_32MEDIA;
+      return true;
+
+    case OPT_m5_32media_nofpu:
+      opts->x_target_flags
+       = (opts->x_target_flags & ~MASK_ARCH) | SELECT_SH5_32MEDIA_NOFPU;
+      return true;
+
+    case OPT_m5_64media:
+      opts->x_target_flags
+       = (opts->x_target_flags & ~MASK_ARCH) | SELECT_SH5_64MEDIA;
+      return true;
+
+    case OPT_m5_64media_nofpu:
+      opts->x_target_flags
+       = (opts->x_target_flags & ~MASK_ARCH) | SELECT_SH5_64MEDIA_NOFPU;
+      return true;
+
+    case OPT_m5_compact:
+      opts->x_target_flags
+       = (opts->x_target_flags & ~MASK_ARCH) | SELECT_SH5_COMPACT;
+      return true;
+
+    case OPT_m5_compact_nofpu:
+      opts->x_target_flags
+       = (opts->x_target_flags & ~MASK_ARCH) | SELECT_SH5_COMPACT_NOFPU;
+      return true;
+
+    default:
+      return true;
+    }
+}
+
+/* Implement TARGET_OPTION_INIT_STRUCT.  */
+static void
+sh_option_init_struct (struct gcc_options *opts)
+{
+  /* We can't meaningfully test TARGET_SH2E / TARGET_IEEE
+     here, so leave it to TARGET_OPTION_OVERRIDE to set
+     flag_finite_math_only.  We set it to 2 here so we know if the user
+     explicitly requested this to be on or off.  */
+  opts->x_flag_finite_math_only = 2;
+}
+
+#undef TARGET_OPTION_OPTIMIZATION_TABLE
+#define TARGET_OPTION_OPTIMIZATION_TABLE sh_option_optimization_table
+#undef TARGET_OPTION_INIT_STRUCT
+#define TARGET_OPTION_INIT_STRUCT sh_option_init_struct
+#undef TARGET_DEFAULT_TARGET_FLAGS
+#define TARGET_DEFAULT_TARGET_FLAGS TARGET_DEFAULT
+#undef TARGET_HANDLE_OPTION
+#define TARGET_HANDLE_OPTION sh_handle_option
+
+struct gcc_targetm_common targetm_common = TARGETM_COMMON_INITIALIZER;
diff --git a/gcc/common/config/sparc/sparc-common.c b/gcc/common/config/sparc/sparc-common.c
new file mode 100644 (file)
index 0000000..fe2ee6d
--- /dev/null
@@ -0,0 +1,42 @@
+/* Common hooks for SPARC.
+   Copyright (C) 1987, 1988, 1989, 1992, 1993, 1994, 1995, 1996, 1997, 1998,
+   1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010,
+   2011
+   Free Software Foundation, Inc.
+
+This file is part of GCC.
+
+GCC is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 3, or (at your option)
+any later version.
+
+GCC is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GCC; see the file COPYING3.  If not see
+<http://www.gnu.org/licenses/>.  */
+
+#include "config.h"
+#include "system.h"
+#include "coretypes.h"
+#include "tm.h"
+#include "common/common-target.h"
+#include "common/common-target-def.h"
+
+/* Implement TARGET_OPTION_OPTIMIZATION_TABLE.  */
+static const struct default_options sparc_option_optimization_table[] =
+  {
+    { OPT_LEVELS_1_PLUS, OPT_fomit_frame_pointer, NULL, 1 },
+    { OPT_LEVELS_NONE, 0, NULL, 0 }
+  };
+
+#undef TARGET_DEFAULT_TARGET_FLAGS
+#define TARGET_DEFAULT_TARGET_FLAGS TARGET_DEFAULT
+#undef TARGET_OPTION_OPTIMIZATION_TABLE
+#define TARGET_OPTION_OPTIMIZATION_TABLE sparc_option_optimization_table
+
+struct gcc_targetm_common targetm_common = TARGETM_COMMON_INITIALIZER;
diff --git a/gcc/common/config/spu/spu-common.c b/gcc/common/config/spu/spu-common.c
new file mode 100644 (file)
index 0000000..d4a9f3c
--- /dev/null
@@ -0,0 +1,44 @@
+/* Common hooks for SPU.
+   Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011
+   Free Software Foundation, Inc.
+
+   This file is free software; you can redistribute it and/or modify it under
+   the terms of the GNU General Public License as published by the Free
+   Software Foundation; either version 3 of the License, or (at your option) 
+   any later version.
+
+   This file is distributed in the hope that it will be useful, but WITHOUT
+   ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+   FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+   for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with GCC; see the file COPYING3.  If not see
+   <http://www.gnu.org/licenses/>.  */
+
+#include "config.h"
+#include "system.h"
+#include "coretypes.h"
+#include "tm.h"
+#include "common/common-target.h"
+#include "common/common-target-def.h"
+#include "opts.h"
+#include "flags.h"
+
+static void
+spu_option_init_struct (struct gcc_options *opts)
+{
+  /* With so many registers this is better on by default. */
+  opts->x_flag_rename_registers = 1;
+}
+
+#undef TARGET_DEFAULT_TARGET_FLAGS
+#define TARGET_DEFAULT_TARGET_FLAGS (TARGET_DEFAULT)
+
+#undef TARGET_OPTION_INIT_STRUCT
+#define TARGET_OPTION_INIT_STRUCT spu_option_init_struct
+
+#undef TARGET_EXCEPT_UNWIND_INFO
+#define TARGET_EXCEPT_UNWIND_INFO  sjlj_except_unwind_info
+
+struct gcc_targetm_common targetm_common = TARGETM_COMMON_INITIALIZER;
diff --git a/gcc/common/config/v850/v850-common.c b/gcc/common/config/v850/v850-common.c
new file mode 100644 (file)
index 0000000..0e2d817
--- /dev/null
@@ -0,0 +1,133 @@
+/* Common hooks for NEC V850 series.
+   Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
+   2006, 2007, 2008, 2009, 2010, 2011 Free Software Foundation, Inc.
+
+   This file is part of GCC.
+
+   GCC is free software; you can redistribute it and/or modify it
+   under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3, or (at your option)
+   any later version.
+
+   GCC is distributed in the hope that it will be useful, but WITHOUT
+   ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+   FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+   for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with GCC; see the file COPYING3.  If not see
+   <http://www.gnu.org/licenses/>.  */
+
+#include "config.h"
+#include "system.h"
+#include "coretypes.h"
+#include "diagnostic-core.h"
+#include "tm.h"
+#include "common/common-target.h"
+#include "common/common-target-def.h"
+#include "opts.h"
+#include "flags.h"
+
+/* Information about the various small memory areas.  */
+static const int small_memory_physical_max[(int) SMALL_MEMORY_max] =
+{
+  256,
+  65536,
+  32768,
+};
+
+/* Set the maximum size of small memory area TYPE to the value given
+   by SIZE in structure OPTS (option text OPT passed at location LOC).  */
+
+static void
+v850_handle_memory_option (enum small_memory_type type,
+                          struct gcc_options *opts, const char *opt,
+                          int size, location_t loc)
+{
+  if (size > small_memory_physical_max[type])
+    error_at (loc, "value passed in %qs is too large", opt);
+  else
+    opts->x_small_memory_max[type] = size;
+}
+
+/* Implement TARGET_HANDLE_OPTION.  */
+
+static bool
+v850_handle_option (struct gcc_options *opts,
+                   struct gcc_options *opts_set ATTRIBUTE_UNUSED,
+                   const struct cl_decoded_option *decoded,
+                   location_t loc)
+{
+  size_t code = decoded->opt_index;
+  int value = decoded->value;
+
+  switch (code)
+    {
+    case OPT_mspace:
+      opts->x_target_flags |= MASK_EP | MASK_PROLOG_FUNCTION;
+      return true;
+
+    case OPT_mv850:
+      opts->x_target_flags &= ~(MASK_CPU ^ MASK_V850);
+      return true;
+
+    case OPT_mv850e:
+    case OPT_mv850e1:
+    case OPT_mv850es:
+      opts->x_target_flags &= ~(MASK_CPU ^ MASK_V850E);
+      return true;
+
+    case OPT_mv850e2:
+      opts->x_target_flags &= ~(MASK_CPU ^ MASK_V850E2);
+      return true;
+
+    case OPT_mv850e2v3:
+      opts->x_target_flags &= ~(MASK_CPU ^ MASK_V850E2V3);
+      return true;
+
+    case OPT_mtda_:
+      v850_handle_memory_option (SMALL_MEMORY_TDA, opts,
+                                decoded->orig_option_with_args_text,
+                                value, loc);
+      return true;
+
+    case OPT_msda_:
+      v850_handle_memory_option (SMALL_MEMORY_SDA, opts,
+                                decoded->orig_option_with_args_text,
+                                value, loc);
+      return true;
+
+    case OPT_mzda_:
+      v850_handle_memory_option (SMALL_MEMORY_ZDA, opts,
+                                decoded->orig_option_with_args_text,
+                                value, loc);
+      return true;
+
+    default:
+      return true;
+    }
+}
+
+/* Implement TARGET_OPTION_OPTIMIZATION_TABLE.  */
+
+static const struct default_options v850_option_optimization_table[] =
+  {
+    { OPT_LEVELS_1_PLUS, OPT_fomit_frame_pointer, NULL, 1 },
+    /* 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.  */
+    { OPT_LEVELS_1_PLUS, OPT_mprolog_function, NULL, 1 },
+    { OPT_LEVELS_NONE, 0, NULL, 0 }
+  };
+
+#undef  TARGET_DEFAULT_TARGET_FLAGS
+#define TARGET_DEFAULT_TARGET_FLAGS (MASK_DEFAULT | MASK_APP_REGS)
+#undef  TARGET_HANDLE_OPTION
+#define TARGET_HANDLE_OPTION v850_handle_option
+#undef  TARGET_OPTION_OPTIMIZATION_TABLE
+#define TARGET_OPTION_OPTIMIZATION_TABLE v850_option_optimization_table
+
+struct gcc_targetm_common targetm_common = TARGETM_COMMON_INITIALIZER;
diff --git a/gcc/common/config/vax/vax-common.c b/gcc/common/config/vax/vax-common.c
new file mode 100644 (file)
index 0000000..11b1a4e
--- /dev/null
@@ -0,0 +1,32 @@
+/* Common hooks for VAX.
+   Copyright (C) 1987, 1994, 1995, 1997, 1998, 1999, 2000, 2001, 2002,
+   2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011
+   Free Software Foundation, Inc.
+
+This file is part of GCC.
+
+GCC is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 3, or (at your option)
+any later version.
+
+GCC is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GCC; see the file COPYING3.  If not see
+<http://www.gnu.org/licenses/>.  */
+
+#include "config.h"
+#include "system.h"
+#include "coretypes.h"
+#include "tm.h"
+#include "common/common-target.h"
+#include "common/common-target-def.h"
+
+#undef TARGET_DEFAULT_TARGET_FLAGS
+#define TARGET_DEFAULT_TARGET_FLAGS TARGET_DEFAULT
+
+struct gcc_targetm_common targetm_common = TARGETM_COMMON_INITIALIZER;
diff --git a/gcc/common/config/xstormy16/xstormy16-common.c b/gcc/common/config/xstormy16/xstormy16-common.c
new file mode 100644 (file)
index 0000000..23850c2
--- /dev/null
@@ -0,0 +1,38 @@
+/* Common hooks for Xstormy16.
+   Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
+   2006, 2007, 2008, 2009, 2010, 2011  Free Software Foundation, Inc.
+
+   This file is part of GCC.
+
+   GCC is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3, or (at your option)
+   any later version.
+
+   GCC is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with GCC; see the file COPYING3.  If not see
+   <http://www.gnu.org/licenses/>.  */
+
+#include "config.h"
+#include "system.h"
+#include "coretypes.h"
+#include "tm.h"
+#include "common/common-target.h"
+#include "common/common-target-def.h"
+
+/* Implement TARGET_OPTION_OPTIMIZATION_TABLE.  */
+static const struct default_options xstorym16_option_optimization_table[] =
+  {
+    { OPT_LEVELS_1_PLUS, OPT_fomit_frame_pointer, NULL, 1 },
+    { OPT_LEVELS_NONE, 0, NULL, 0 }
+  };
+
+#undef TARGET_OPTION_OPTIMIZATION_TABLE
+#define TARGET_OPTION_OPTIMIZATION_TABLE xstorym16_option_optimization_table
+
+struct gcc_targetm_common targetm_common = TARGETM_COMMON_INITIALIZER;
diff --git a/gcc/common/config/xtensa/xtensa-common.c b/gcc/common/config/xtensa/xtensa-common.c
new file mode 100644 (file)
index 0000000..4770f45
--- /dev/null
@@ -0,0 +1,47 @@
+/* Common hooks for Tensilica's Xtensa architecture.
+   Copyright 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011
+   Free Software Foundation, Inc.
+
+This file is part of GCC.
+
+GCC is free software; you can redistribute it and/or modify it under
+the terms of the GNU General Public License as published by the Free
+Software Foundation; either version 3, or (at your option) any later
+version.
+
+GCC is distributed in the hope that it will be useful, but WITHOUT ANY
+WARRANTY; without even the implied warranty of MERCHANTABILITY or
+FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+for more details.
+
+You should have received a copy of the GNU General Public License
+along with GCC; see the file COPYING3.  If not see
+<http://www.gnu.org/licenses/>.  */
+
+#include "config.h"
+#include "system.h"
+#include "coretypes.h"
+#include "tm.h"
+#include "common/common-target.h"
+#include "common/common-target-def.h"
+
+/* Implement TARGET_OPTION_OPTIMIZATION_TABLE.  */
+
+static const struct default_options xtensa_option_optimization_table[] =
+  {
+    { OPT_LEVELS_1_PLUS, OPT_fomit_frame_pointer, NULL, 1 },
+    /* 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.  */
+    { OPT_LEVELS_ALL, OPT_freorder_blocks, NULL, 0 },
+    { OPT_LEVELS_NONE, 0, NULL, 0 }
+  };
+
+#undef TARGET_DEFAULT_TARGET_FLAGS
+#define TARGET_DEFAULT_TARGET_FLAGS (TARGET_DEFAULT)
+#undef TARGET_OPTION_OPTIMIZATION_TABLE
+#define TARGET_OPTION_OPTIMIZATION_TABLE xtensa_option_optimization_table
+
+struct gcc_targetm_common targetm_common = TARGETM_COMMON_INITIALIZER;
index ee9391d58cddedce26f2541bb8caf2812c5bdd94..2a67bc4006eb4da056d819828208a1875e74d7db 100644 (file)
@@ -217,7 +217,7 @@ c_target_objs=
 cxx_target_objs=
 fortran_target_objs=
 target_has_targetcm=no
-target_has_targetm_common=no
+target_has_targetm_common=yes
 tm_defines=
 xm_defines=
 libgcc_tm_file=
@@ -329,6 +329,7 @@ frv*)       cpu_type=frv
        extra_options="${extra_options} g.opt"
        ;;
 moxie*)        cpu_type=moxie
+       target_has_targetm_common=no
        ;;
 fido-*-*)
        cpu_type=m68k
@@ -367,7 +368,6 @@ ia64-*-*)
        ;;
 hppa*-*-*)
        cpu_type=pa
-       target_has_targetm_common=yes
        ;;
 lm32*)
        extra_options="${extra_options} g.opt"
index adef2c639ea5caf9cedca354bf6c0f6d2686c0c4..35172967718b201e97a3200491a481dac38ab2a5 100644 (file)
@@ -47,6 +47,7 @@ along with GCC; see the file COPYING3.  If not see
 #include "tm_p.h"
 #include "target.h"
 #include "target-def.h"
+#include "common/common-target.h"
 #include "debug.h"
 #include "langhooks.h"
 #include "splay-tree.h"
@@ -199,46 +200,6 @@ static void alpha_write_linkage (FILE *, const char *, tree);
 static bool vms_valid_pointer_mode (enum machine_mode);
 #endif
 \f
-/* Implement TARGET_OPTION_OPTIMIZATION_TABLE.  */
-static const struct default_options alpha_option_optimization_table[] =
-  {
-    { OPT_LEVELS_1_PLUS, OPT_fomit_frame_pointer, NULL, 1 },
-    { OPT_LEVELS_NONE, 0, NULL, 0 }
-  };
-
-/* Implement TARGET_HANDLE_OPTION.  */
-
-static bool
-alpha_handle_option (struct gcc_options *opts,
-                    struct gcc_options *opts_set ATTRIBUTE_UNUSED,
-                    const struct cl_decoded_option *decoded,
-                    location_t loc)
-{
-  size_t code = decoded->opt_index;
-  const char *arg = decoded->arg;
-  int value = decoded->value;
-
-  switch (code)
-    {
-    case OPT_mfp_regs:
-      if (value == 0)
-       opts->x_target_flags |= MASK_SOFT_FP;
-      break;
-
-    case OPT_mieee:
-    case OPT_mieee_with_inexact:
-      opts->x_target_flags |= MASK_IEEE_CONFORMANT;
-      break;
-
-    case OPT_mtls_size_:
-      if (value != 16 && value != 32 && value != 64)
-       error_at (loc, "bad value %qs for -mtls-size switch", arg);
-      break;
-    }
-
-  return true;
-}
-
 #ifdef TARGET_ALTERNATE_LONG_DOUBLE_MANGLING
 /* Implement TARGET_MANGLE_TYPE.  */
 
@@ -9932,18 +9893,9 @@ alpha_conditional_register_usage (void)
 #undef TARGET_RELAXED_ORDERING
 #define TARGET_RELAXED_ORDERING true
 
-#undef TARGET_DEFAULT_TARGET_FLAGS
-#define TARGET_DEFAULT_TARGET_FLAGS \
-  (TARGET_DEFAULT | TARGET_CPU_DEFAULT | TARGET_DEFAULT_EXPLICIT_RELOCS)
-#undef TARGET_HANDLE_OPTION
-#define TARGET_HANDLE_OPTION alpha_handle_option
-
 #undef TARGET_OPTION_OVERRIDE
 #define TARGET_OPTION_OVERRIDE alpha_option_override
 
-#undef TARGET_OPTION_OPTIMIZATION_TABLE
-#define TARGET_OPTION_OPTIMIZATION_TABLE alpha_option_optimization_table
-
 #ifdef TARGET_ALTERNATE_LONG_DOUBLE_MANGLING
 #undef TARGET_MANGLE_TYPE
 #define TARGET_MANGLE_TYPE alpha_mangle_type
index 9132b6d0910467c5664c03ad3899242293fe6fa3..8f7d18ad882f1e9009d977c6517a7819f5b56957 100644 (file)
@@ -23,6 +23,7 @@
 #ifndef GCC_ARM_PROTOS_H
 #define GCC_ARM_PROTOS_H
 
+extern enum unwind_info_type arm_except_unwind_info (struct gcc_options *);
 extern int use_return_insn (int, rtx);
 extern enum reg_class arm_regno_class (int);
 extern void arm_load_pic_register (unsigned long);
index efc2bcb1ee5ea8ccd4e228466827caf8fb4fef04..717e289e4c98c63ffcb7e7152592aa044189e4d0 100644 (file)
@@ -204,7 +204,6 @@ static bool arm_output_ttype (rtx);
 static void arm_asm_emit_except_personality (rtx);
 static void arm_asm_init_sections (void);
 #endif
-static enum unwind_info_type arm_except_unwind_info (struct gcc_options *);
 static void arm_dwarf_handle_frame_unspec (const char *, rtx, int);
 static rtx arm_dwarf_register_span (rtx);
 
@@ -303,15 +302,6 @@ static const struct attribute_spec arm_attribute_table[] =
 #endif
   { NULL,           0, 0, false, false, false, NULL, false }
 };
-
-/* Set default optimization options.  */
-static const struct default_options arm_option_optimization_table[] =
-  {
-    /* Enable section anchors by default at -O1 or higher.  */
-    { OPT_LEVELS_1_PLUS, OPT_fsection_anchors, NULL, 1 },
-    { OPT_LEVELS_1_PLUS, OPT_fomit_frame_pointer, NULL, 1 },
-    { OPT_LEVELS_NONE, 0, NULL, 0 }
-  };
 \f
 /* Initialize the GCC target structure.  */
 #if TARGET_DLLIMPORT_DECL_ATTRIBUTES
@@ -351,12 +341,8 @@ static const struct default_options arm_option_optimization_table[] =
 #undef  TARGET_ASM_FUNCTION_EPILOGUE
 #define TARGET_ASM_FUNCTION_EPILOGUE arm_output_function_epilogue
 
-#undef  TARGET_DEFAULT_TARGET_FLAGS
-#define TARGET_DEFAULT_TARGET_FLAGS (TARGET_DEFAULT | MASK_SCHED_PROLOG)
 #undef  TARGET_OPTION_OVERRIDE
 #define TARGET_OPTION_OVERRIDE arm_option_override
-#undef  TARGET_OPTION_OPTIMIZATION_TABLE
-#define TARGET_OPTION_OPTIMIZATION_TABLE arm_option_optimization_table
 
 #undef  TARGET_COMP_TYPE_ATTRIBUTES
 #define TARGET_COMP_TYPE_ATTRIBUTES arm_comp_type_attributes
@@ -516,9 +502,6 @@ static const struct default_options arm_option_optimization_table[] =
 #define TARGET_ASM_INIT_SECTIONS arm_asm_init_sections
 #endif /* ARM_UNWIND_INFO */
 
-#undef TARGET_EXCEPT_UNWIND_INFO
-#define TARGET_EXCEPT_UNWIND_INFO  arm_except_unwind_info
-
 #undef TARGET_DWARF_HANDLE_FRAME_UNSPEC
 #define TARGET_DWARF_HANDLE_FRAME_UNSPEC arm_dwarf_handle_frame_unspec
 
@@ -22848,33 +22831,6 @@ arm_asm_init_sections (void)
 }
 #endif /* ARM_UNWIND_INFO */
 
-/* Implement TARGET_EXCEPT_UNWIND_INFO.  */
-
-static enum unwind_info_type
-arm_except_unwind_info (struct gcc_options *opts)
-{
-  /* Honor the --enable-sjlj-exceptions configure switch.  */
-#ifdef CONFIG_SJLJ_EXCEPTIONS
-  if (CONFIG_SJLJ_EXCEPTIONS)
-    return UI_SJLJ;
-#endif
-
-  /* If not using ARM EABI unwind tables... */
-  if (ARM_UNWIND_INFO)
-    {
-      /* For simplicity elsewhere in this file, indicate that all unwind
-        info is disabled if we're not emitting unwind tables.  */
-      if (!opts->x_flag_exceptions && !opts->x_flag_unwind_tables)
-       return UI_NONE;
-      else
-       return UI_TARGET;
-    }
-
-  /* ... we use sjlj exceptions for backwards compatibility.  */
-  return UI_SJLJ;
-}
-
-
 /* Handle UNSPEC DWARF call frame instructions.  These are needed for dynamic
    stack alignment.  */
 
index aadfd244b68e92c9ffca9de69b1cfac7aa687655..de24937e4d30fc6b8bc71196979350086cf63739 100644 (file)
@@ -156,13 +156,6 @@ static const struct attribute_spec avr_attribute_table[] =
     false },
   { NULL,        0, 0, false, false, false, NULL, false }
 };
-
-/* Implement TARGET_OPTION_OPTIMIZATION_TABLE.  */
-static const struct default_options avr_option_optimization_table[] =
-  {
-    { OPT_LEVELS_1_PLUS, OPT_fomit_frame_pointer, NULL, 1 },
-    { OPT_LEVELS_NONE, 0, NULL, 0 }
-  };
 \f
 /* Initialize the GCC target structure.  */
 #undef TARGET_ASM_ALIGNED_HI_OP
@@ -254,18 +247,12 @@ static const struct default_options avr_option_optimization_table[] =
 #undef TARGET_OPTION_OVERRIDE
 #define TARGET_OPTION_OVERRIDE avr_option_override
 
-#undef TARGET_OPTION_OPTIMIZATION_TABLE
-#define TARGET_OPTION_OPTIMIZATION_TABLE avr_option_optimization_table
-
 #undef TARGET_CANNOT_MODIFY_JUMPS_P
 #define TARGET_CANNOT_MODIFY_JUMPS_P avr_cannot_modify_jumps_p
 
 #undef TARGET_HELP
 #define TARGET_HELP avr_help
 
-#undef TARGET_EXCEPT_UNWIND_INFO
-#define TARGET_EXCEPT_UNWIND_INFO sjlj_except_unwind_info
-
 #undef TARGET_FUNCTION_OK_FOR_SIBCALL
 #define TARGET_FUNCTION_OK_FOR_SIBCALL avr_function_ok_for_sibcall
 
index 2af0afe6db565e398e15bf7f329cd1d016b34a6f..e5fae38001aa89eccc5b3e162e2b188cb8101d0a 100644 (file)
@@ -86,270 +86,6 @@ const char *byte_reg_names[]   =  BYTE_REGISTER_NAMES;
 static int arg_regs[] = FUNCTION_ARG_REGISTERS;
 static int ret_regs[] = FUNCTION_RETURN_REGISTERS;
 
-struct bfin_cpu
-{
-  const char *name;
-  bfin_cpu_t type;
-  int si_revision;
-  unsigned int workarounds;
-};
-
-static const struct bfin_cpu bfin_cpus[] =
-{
-
-  {"bf512", BFIN_CPU_BF512, 0x0002,
-   WA_SPECULATIVE_LOADS | WA_05000074},
-  {"bf512", BFIN_CPU_BF512, 0x0001,
-   WA_SPECULATIVE_LOADS | WA_05000074},
-  {"bf512", BFIN_CPU_BF512, 0x0000,
-   WA_SPECULATIVE_LOADS | WA_05000074},
-
-  {"bf514", BFIN_CPU_BF514, 0x0002,
-   WA_SPECULATIVE_LOADS | WA_05000074},
-  {"bf514", BFIN_CPU_BF514, 0x0001,
-   WA_SPECULATIVE_LOADS | WA_05000074},
-  {"bf514", BFIN_CPU_BF514, 0x0000,
-   WA_SPECULATIVE_LOADS | WA_05000074},
-
-  {"bf516", BFIN_CPU_BF516, 0x0002,
-   WA_SPECULATIVE_LOADS | WA_05000074},
-  {"bf516", BFIN_CPU_BF516, 0x0001,
-   WA_SPECULATIVE_LOADS | WA_05000074},
-  {"bf516", BFIN_CPU_BF516, 0x0000,
-   WA_SPECULATIVE_LOADS | WA_05000074},
-
-  {"bf518", BFIN_CPU_BF518, 0x0002,
-   WA_SPECULATIVE_LOADS | WA_05000074},
-  {"bf518", BFIN_CPU_BF518, 0x0001,
-   WA_SPECULATIVE_LOADS | WA_05000074},
-  {"bf518", BFIN_CPU_BF518, 0x0000,
-   WA_SPECULATIVE_LOADS | WA_05000074},
-
-  {"bf522", BFIN_CPU_BF522, 0x0002,
-   WA_SPECULATIVE_LOADS | WA_05000074},
-  {"bf522", BFIN_CPU_BF522, 0x0001,
-   WA_SPECULATIVE_LOADS | WA_RETS | WA_05000074},
-  {"bf522", BFIN_CPU_BF522, 0x0000,
-   WA_SPECULATIVE_LOADS | WA_RETS | WA_05000074},
-
-  {"bf523", BFIN_CPU_BF523, 0x0002,
-   WA_SPECULATIVE_LOADS | WA_05000074},
-  {"bf523", BFIN_CPU_BF523, 0x0001,
-   WA_SPECULATIVE_LOADS | WA_RETS | WA_05000074},
-  {"bf523", BFIN_CPU_BF523, 0x0000,
-   WA_SPECULATIVE_LOADS | WA_RETS | WA_05000074},
-
-  {"bf524", BFIN_CPU_BF524, 0x0002,
-   WA_SPECULATIVE_LOADS | WA_05000074},
-  {"bf524", BFIN_CPU_BF524, 0x0001,
-   WA_SPECULATIVE_LOADS | WA_RETS | WA_05000074},
-  {"bf524", BFIN_CPU_BF524, 0x0000,
-   WA_SPECULATIVE_LOADS | WA_RETS | WA_05000074},
-
-  {"bf525", BFIN_CPU_BF525, 0x0002,
-   WA_SPECULATIVE_LOADS | WA_05000074},
-  {"bf525", BFIN_CPU_BF525, 0x0001,
-   WA_SPECULATIVE_LOADS | WA_RETS | WA_05000074},
-  {"bf525", BFIN_CPU_BF525, 0x0000,
-   WA_SPECULATIVE_LOADS | WA_RETS | WA_05000074},
-
-  {"bf526", BFIN_CPU_BF526, 0x0002,
-   WA_SPECULATIVE_LOADS | WA_05000074},
-  {"bf526", BFIN_CPU_BF526, 0x0001,
-   WA_SPECULATIVE_LOADS | WA_RETS | WA_05000074},
-  {"bf526", BFIN_CPU_BF526, 0x0000,
-   WA_SPECULATIVE_LOADS | WA_RETS | WA_05000074},
-
-  {"bf527", BFIN_CPU_BF527, 0x0002,
-   WA_SPECULATIVE_LOADS | WA_05000074},
-  {"bf527", BFIN_CPU_BF527, 0x0001,
-   WA_SPECULATIVE_LOADS | WA_RETS | WA_05000074},
-  {"bf527", BFIN_CPU_BF527, 0x0000,
-   WA_SPECULATIVE_LOADS | WA_RETS | WA_05000074},
-
-  {"bf531", BFIN_CPU_BF531, 0x0006,
-   WA_SPECULATIVE_LOADS | WA_LOAD_LCREGS | WA_05000074},
-  {"bf531", BFIN_CPU_BF531, 0x0005,
-   WA_SPECULATIVE_LOADS | WA_RETS | WA_05000283 | WA_05000315
-   | WA_LOAD_LCREGS | WA_05000074},
-  {"bf531", BFIN_CPU_BF531, 0x0004,
-   WA_SPECULATIVE_LOADS | WA_SPECULATIVE_SYNCS | WA_RETS
-   | WA_05000283 | WA_05000257 | WA_05000315 | WA_LOAD_LCREGS
-   | WA_05000074},
-  {"bf531", BFIN_CPU_BF531, 0x0003,
-   WA_SPECULATIVE_LOADS | WA_SPECULATIVE_SYNCS | WA_RETS
-   | WA_05000283 | WA_05000257 | WA_05000315 | WA_LOAD_LCREGS
-   | WA_05000074},
-
-  {"bf532", BFIN_CPU_BF532, 0x0006,
-   WA_SPECULATIVE_LOADS | WA_LOAD_LCREGS | WA_05000074},
-  {"bf532", BFIN_CPU_BF532, 0x0005,
-   WA_SPECULATIVE_LOADS | WA_RETS | WA_05000283 | WA_05000315
-   | WA_LOAD_LCREGS | WA_05000074},
-  {"bf532", BFIN_CPU_BF532, 0x0004,
-   WA_SPECULATIVE_LOADS | WA_SPECULATIVE_SYNCS | WA_RETS
-   | WA_05000283 | WA_05000257 | WA_05000315 | WA_LOAD_LCREGS
-   | WA_05000074},
-  {"bf532", BFIN_CPU_BF532, 0x0003,
-   WA_SPECULATIVE_LOADS | WA_SPECULATIVE_SYNCS | WA_RETS
-   | WA_05000283 | WA_05000257 | WA_05000315 | WA_LOAD_LCREGS
-   | WA_05000074},
-
-  {"bf533", BFIN_CPU_BF533, 0x0006,
-   WA_SPECULATIVE_LOADS | WA_LOAD_LCREGS | WA_05000074},
-  {"bf533", BFIN_CPU_BF533, 0x0005,
-   WA_SPECULATIVE_LOADS | WA_RETS | WA_05000283 | WA_05000315
-   | WA_LOAD_LCREGS | WA_05000074},
-  {"bf533", BFIN_CPU_BF533, 0x0004,
-   WA_SPECULATIVE_LOADS | WA_SPECULATIVE_SYNCS | WA_RETS
-   | WA_05000283 | WA_05000257 | WA_05000315 | WA_LOAD_LCREGS
-   | WA_05000074},
-  {"bf533", BFIN_CPU_BF533, 0x0003,
-   WA_SPECULATIVE_LOADS | WA_SPECULATIVE_SYNCS | WA_RETS
-   | WA_05000283 | WA_05000257 | WA_05000315 | WA_LOAD_LCREGS
-   | WA_05000074},
-
-  {"bf534", BFIN_CPU_BF534, 0x0003,
-   WA_SPECULATIVE_LOADS | WA_RETS | WA_LOAD_LCREGS | WA_05000074},
-  {"bf534", BFIN_CPU_BF534, 0x0002,
-   WA_SPECULATIVE_LOADS | WA_SPECULATIVE_SYNCS | WA_RETS
-   | WA_05000283 | WA_05000257 | WA_05000315 | WA_LOAD_LCREGS
-   | WA_05000074},
-  {"bf534", BFIN_CPU_BF534, 0x0001,
-   WA_SPECULATIVE_LOADS | WA_SPECULATIVE_SYNCS | WA_RETS
-   | WA_05000283 | WA_05000257 | WA_05000315 | WA_LOAD_LCREGS
-   | WA_05000074},
-
-  {"bf536", BFIN_CPU_BF536, 0x0003,
-   WA_SPECULATIVE_LOADS | WA_RETS | WA_LOAD_LCREGS | WA_05000074},
-  {"bf536", BFIN_CPU_BF536, 0x0002,
-   WA_SPECULATIVE_LOADS | WA_SPECULATIVE_SYNCS | WA_RETS
-   | WA_05000283 | WA_05000257 | WA_05000315 | WA_LOAD_LCREGS
-   | WA_05000074},
-  {"bf536", BFIN_CPU_BF536, 0x0001,
-   WA_SPECULATIVE_LOADS | WA_SPECULATIVE_SYNCS | WA_RETS
-   | WA_05000283 | WA_05000257 | WA_05000315 | WA_LOAD_LCREGS
-   | WA_05000074},
-
-  {"bf537", BFIN_CPU_BF537, 0x0003,
-   WA_SPECULATIVE_LOADS | WA_RETS | WA_LOAD_LCREGS | WA_05000074},
-  {"bf537", BFIN_CPU_BF537, 0x0002,
-   WA_SPECULATIVE_LOADS | WA_SPECULATIVE_SYNCS | WA_RETS
-   | WA_05000283 | WA_05000257 | WA_05000315 | WA_LOAD_LCREGS
-   | WA_05000074},
-  {"bf537", BFIN_CPU_BF537, 0x0001,
-   WA_SPECULATIVE_LOADS | WA_SPECULATIVE_SYNCS | WA_RETS
-   | WA_05000283 | WA_05000257 | WA_05000315 | WA_LOAD_LCREGS
-   | WA_05000074},
-
-  {"bf538", BFIN_CPU_BF538, 0x0005,
-   WA_SPECULATIVE_LOADS | WA_LOAD_LCREGS | WA_05000074},
-  {"bf538", BFIN_CPU_BF538, 0x0004,
-   WA_SPECULATIVE_LOADS | WA_RETS | WA_LOAD_LCREGS | WA_05000074},
-  {"bf538", BFIN_CPU_BF538, 0x0003,
-   WA_SPECULATIVE_LOADS | WA_RETS
-   | WA_05000283 | WA_05000315 | WA_LOAD_LCREGS | WA_05000074},
-  {"bf538", BFIN_CPU_BF538, 0x0002,
-   WA_SPECULATIVE_LOADS | WA_RETS
-   | WA_05000283 | WA_05000257 | WA_05000315 | WA_LOAD_LCREGS
-   | WA_05000074},
-
-  {"bf539", BFIN_CPU_BF539, 0x0005,
-   WA_SPECULATIVE_LOADS | WA_LOAD_LCREGS | WA_05000074},
-  {"bf539", BFIN_CPU_BF539, 0x0004,
-   WA_SPECULATIVE_LOADS | WA_RETS | WA_LOAD_LCREGS | WA_05000074},
-  {"bf539", BFIN_CPU_BF539, 0x0003,
-   WA_SPECULATIVE_LOADS | WA_RETS
-   | WA_05000283 | WA_05000315 | WA_LOAD_LCREGS | WA_05000074},
-  {"bf539", BFIN_CPU_BF539, 0x0002,
-   WA_SPECULATIVE_LOADS | WA_RETS
-   | WA_05000283 | WA_05000257 | WA_05000315 | WA_LOAD_LCREGS
-   | WA_05000074},
-
-  {"bf542m", BFIN_CPU_BF542M, 0x0003,
-   WA_SPECULATIVE_LOADS | WA_INDIRECT_CALLS | WA_05000074},
-
-  {"bf542", BFIN_CPU_BF542, 0x0004,
-   WA_SPECULATIVE_LOADS | WA_INDIRECT_CALLS | WA_05000074},
-  {"bf542", BFIN_CPU_BF542, 0x0002,
-   WA_SPECULATIVE_LOADS | WA_INDIRECT_CALLS | WA_05000074},
-  {"bf542", BFIN_CPU_BF542, 0x0001,
-   WA_SPECULATIVE_LOADS | WA_RETS | WA_INDIRECT_CALLS | WA_05000074},
-  {"bf542", BFIN_CPU_BF542, 0x0000,
-   WA_SPECULATIVE_LOADS | WA_RETS | WA_INDIRECT_CALLS | WA_LOAD_LCREGS
-   | WA_05000074},
-
-  {"bf544m", BFIN_CPU_BF544M, 0x0003,
-   WA_SPECULATIVE_LOADS | WA_INDIRECT_CALLS | WA_05000074},
-
-  {"bf544", BFIN_CPU_BF544, 0x0004,
-   WA_SPECULATIVE_LOADS | WA_INDIRECT_CALLS | WA_05000074},
-  {"bf544", BFIN_CPU_BF544, 0x0002,
-   WA_SPECULATIVE_LOADS | WA_INDIRECT_CALLS | WA_05000074},
-  {"bf544", BFIN_CPU_BF544, 0x0001,
-   WA_SPECULATIVE_LOADS | WA_RETS | WA_INDIRECT_CALLS | WA_05000074},
-  {"bf544", BFIN_CPU_BF544, 0x0000,
-   WA_SPECULATIVE_LOADS | WA_RETS | WA_INDIRECT_CALLS | WA_LOAD_LCREGS
-   | WA_05000074},
-
-  {"bf547m", BFIN_CPU_BF547M, 0x0003,
-   WA_SPECULATIVE_LOADS | WA_INDIRECT_CALLS | WA_05000074},
-
-  {"bf547", BFIN_CPU_BF547, 0x0004,
-   WA_SPECULATIVE_LOADS | WA_INDIRECT_CALLS | WA_05000074},
-  {"bf547", BFIN_CPU_BF547, 0x0002,
-   WA_SPECULATIVE_LOADS | WA_INDIRECT_CALLS | WA_05000074},
-  {"bf547", BFIN_CPU_BF547, 0x0001,
-   WA_SPECULATIVE_LOADS | WA_RETS | WA_INDIRECT_CALLS | WA_05000074},
-  {"bf547", BFIN_CPU_BF547, 0x0000,
-   WA_SPECULATIVE_LOADS | WA_RETS | WA_INDIRECT_CALLS | WA_LOAD_LCREGS
-   | WA_05000074},
-
-  {"bf548m", BFIN_CPU_BF548M, 0x0003,
-   WA_SPECULATIVE_LOADS | WA_INDIRECT_CALLS | WA_05000074},
-
-  {"bf548", BFIN_CPU_BF548, 0x0004,
-   WA_SPECULATIVE_LOADS | WA_INDIRECT_CALLS | WA_05000074},
-  {"bf548", BFIN_CPU_BF548, 0x0002,
-   WA_SPECULATIVE_LOADS | WA_INDIRECT_CALLS | WA_05000074},
-  {"bf548", BFIN_CPU_BF548, 0x0001,
-   WA_SPECULATIVE_LOADS | WA_RETS | WA_INDIRECT_CALLS | WA_05000074},
-  {"bf548", BFIN_CPU_BF548, 0x0000,
-   WA_SPECULATIVE_LOADS | WA_RETS | WA_INDIRECT_CALLS | WA_LOAD_LCREGS
-   | WA_05000074},
-
-  {"bf549m", BFIN_CPU_BF549M, 0x0003,
-   WA_SPECULATIVE_LOADS | WA_INDIRECT_CALLS | WA_05000074},
-
-  {"bf549", BFIN_CPU_BF549, 0x0004,
-   WA_SPECULATIVE_LOADS | WA_INDIRECT_CALLS | WA_05000074},
-  {"bf549", BFIN_CPU_BF549, 0x0002,
-   WA_SPECULATIVE_LOADS | WA_INDIRECT_CALLS | WA_05000074},
-  {"bf549", BFIN_CPU_BF549, 0x0001,
-   WA_SPECULATIVE_LOADS | WA_RETS | WA_INDIRECT_CALLS | WA_05000074},
-  {"bf549", BFIN_CPU_BF549, 0x0000,
-   WA_SPECULATIVE_LOADS | WA_RETS | WA_INDIRECT_CALLS | WA_LOAD_LCREGS
-   | WA_05000074},
-
-  {"bf561", BFIN_CPU_BF561, 0x0005, WA_RETS
-   | WA_05000283 | WA_05000315 | WA_LOAD_LCREGS | WA_05000074},
-  {"bf561", BFIN_CPU_BF561, 0x0003,
-   WA_SPECULATIVE_LOADS | WA_SPECULATIVE_SYNCS | WA_RETS
-   | WA_05000283 | WA_05000257 | WA_05000315 | WA_LOAD_LCREGS
-   | WA_05000074},
-  {"bf561", BFIN_CPU_BF561, 0x0002,
-   WA_SPECULATIVE_LOADS | WA_SPECULATIVE_SYNCS | WA_RETS
-   | WA_05000283 | WA_05000257 | WA_05000315 | WA_LOAD_LCREGS
-   | WA_05000074},
-
-  {"bf592", BFIN_CPU_BF592, 0x0001,
-   WA_SPECULATIVE_LOADS | WA_05000074},
-  {"bf592", BFIN_CPU_BF592, 0x0000,
-   WA_SPECULATIVE_LOADS | WA_05000074},
-
-  {NULL, BFIN_CPU_UNKNOWN, 0, 0}
-};
-
 int splitting_for_sched, splitting_loops;
 
 static void
@@ -2572,101 +2308,6 @@ bfin_class_likely_spilled_p (reg_class_t rclass)
   return false;
 }
 \f
-/* Implement TARGET_HANDLE_OPTION.  */
-
-static bool
-bfin_handle_option (struct gcc_options *opts,
-                   struct gcc_options *opts_set ATTRIBUTE_UNUSED,
-                   const struct cl_decoded_option *decoded,
-                   location_t loc)
-{
-  size_t code = decoded->opt_index;
-  const char *arg = decoded->arg;
-  int value = decoded->value;
-
-  switch (code)
-    {
-    case OPT_mshared_library_id_:
-      if (value > MAX_LIBRARY_ID)
-       error_at (loc, "-mshared-library-id=%s is not between 0 and %d",
-                 arg, MAX_LIBRARY_ID);
-      return true;
-
-    case OPT_mcpu_:
-      {
-       const char *p, *q;
-       int i;
-
-       i = 0;
-       while ((p = bfin_cpus[i].name) != NULL)
-         {
-           if (strncmp (arg, p, strlen (p)) == 0)
-             break;
-           i++;
-         }
-
-       if (p == NULL)
-         {
-           error_at (loc, "-mcpu=%s is not valid", arg);
-           return false;
-         }
-
-       opts->x_bfin_cpu_type = bfin_cpus[i].type;
-
-       q = arg + strlen (p);
-
-       if (*q == '\0')
-         {
-           opts->x_bfin_si_revision = bfin_cpus[i].si_revision;
-           opts->x_bfin_workarounds |= bfin_cpus[i].workarounds;
-         }
-       else if (strcmp (q, "-none") == 0)
-         opts->x_bfin_si_revision = -1;
-       else if (strcmp (q, "-any") == 0)
-         {
-           opts->x_bfin_si_revision = 0xffff;
-           while (bfin_cpus[i].type == opts->x_bfin_cpu_type)
-             {
-               opts->x_bfin_workarounds |= bfin_cpus[i].workarounds;
-               i++;
-             }
-         }
-       else
-         {
-           unsigned int si_major, si_minor;
-           int rev_len, n;
-
-           rev_len = strlen (q);
-
-           if (sscanf (q, "-%u.%u%n", &si_major, &si_minor, &n) != 2
-               || n != rev_len
-               || si_major > 0xff || si_minor > 0xff)
-             {
-             invalid_silicon_revision:
-               error_at (loc, "-mcpu=%s has invalid silicon revision", arg);
-               return false;
-             }
-
-           opts->x_bfin_si_revision = (si_major << 8) | si_minor;
-
-           while (bfin_cpus[i].type == opts->x_bfin_cpu_type
-                  && bfin_cpus[i].si_revision != opts->x_bfin_si_revision)
-             i++;
-
-           if (bfin_cpus[i].type != opts->x_bfin_cpu_type)
-             goto invalid_silicon_revision;
-
-           opts->x_bfin_workarounds |= bfin_cpus[i].workarounds;
-         }
-
-       return true;
-      }
-
-    default:
-      return true;
-    }
-}
-
 static struct machine_function *
 bfin_init_machine_status (void)
 {
@@ -6700,15 +6341,9 @@ bfin_conditional_register_usage (void)
 #undef TARGET_VECTOR_MODE_SUPPORTED_P
 #define TARGET_VECTOR_MODE_SUPPORTED_P bfin_vector_mode_supported_p
 
-#undef TARGET_HANDLE_OPTION
-#define TARGET_HANDLE_OPTION bfin_handle_option
-
 #undef TARGET_OPTION_OVERRIDE
 #define TARGET_OPTION_OVERRIDE bfin_option_override
 
-#undef TARGET_DEFAULT_TARGET_FLAGS
-#define TARGET_DEFAULT_TARGET_FLAGS TARGET_DEFAULT
-
 #undef TARGET_SECONDARY_RELOAD
 #define TARGET_SECONDARY_RELOAD bfin_secondary_reload
 
index 4f21a1c8a3262c87631de6ff5e022e53aef20f25..635c61b243aaf151dc5a6abdf3f6dcbe9ce2da16 100644 (file)
@@ -1169,4 +1169,14 @@ extern int splitting_for_sched, splitting_loops;
 #define TARGET_SUPPORTS_SYNC_CALLS 0
 #endif
 
+struct bfin_cpu
+{
+  const char *name;
+  bfin_cpu_t type;
+  int si_revision;
+  unsigned int workarounds;
+};
+
+extern const struct bfin_cpu bfin_cpus[];
+
 #endif /*  _BFIN_CONFIG */
index 159b31bf7f4c9f8fdd4acb46ea48e801af97db32..74ce110098d765adb19f2c9f84de72c4ebc5ab00 100644 (file)
@@ -137,8 +137,6 @@ static void cris_function_arg_advance (CUMULATIVE_ARGS *, enum machine_mode,
                                       const_tree, bool);
 static tree cris_md_asm_clobbers (tree, tree, tree);
 
-static bool cris_handle_option (struct gcc_options *, struct gcc_options *,
-                               const struct cl_decoded_option *, location_t);
 static void cris_option_override (void);
 
 static bool cris_frame_pointer_required (void);
@@ -156,14 +154,6 @@ int cris_max_stackframe = 0;
 /* This is the parsed result of the "-march=" option, if given.  */
 int cris_cpu_version = CRIS_DEFAULT_CPU_VERSION;
 
-/* Implement TARGET_OPTION_OPTIMIZATION_TABLE.  */
-
-static const struct default_options cris_option_optimization_table[] =
-  {
-    { OPT_LEVELS_2_PLUS, OPT_fomit_frame_pointer, NULL, 1 },
-    { OPT_LEVELS_NONE, 0, NULL, 0 }
-  };
-
 #undef TARGET_ASM_ALIGNED_HI_OP
 #define TARGET_ASM_ALIGNED_HI_OP "\t.word\t"
 #undef TARGET_ASM_ALIGNED_SI_OP
@@ -232,17 +222,11 @@ static const struct default_options cris_option_optimization_table[] =
 #define TARGET_FUNCTION_ARG_ADVANCE cris_function_arg_advance
 #undef TARGET_MD_ASM_CLOBBERS
 #define TARGET_MD_ASM_CLOBBERS cris_md_asm_clobbers
-#undef TARGET_DEFAULT_TARGET_FLAGS
-#define TARGET_DEFAULT_TARGET_FLAGS (TARGET_DEFAULT | CRIS_SUBTARGET_DEFAULT)
-#undef TARGET_HANDLE_OPTION
-#define TARGET_HANDLE_OPTION cris_handle_option
 #undef TARGET_FRAME_POINTER_REQUIRED
 #define TARGET_FRAME_POINTER_REQUIRED cris_frame_pointer_required
 
 #undef TARGET_OPTION_OVERRIDE
 #define TARGET_OPTION_OVERRIDE cris_option_override
-#undef TARGET_OPTION_OPTIMIZATION_TABLE
-#define TARGET_OPTION_OPTIMIZATION_TABLE cris_option_optimization_table
 
 #undef TARGET_ASM_TRAMPOLINE_TEMPLATE
 #define TARGET_ASM_TRAMPOLINE_TEMPLATE cris_asm_trampoline_template
@@ -2324,66 +2308,6 @@ cris_asm_output_case_end (FILE *stream, int num, rtx table)
               (TARGET_PDEBUG ? "; default" : ""));
 }
 
-/* TARGET_HANDLE_OPTION worker.  We just store the values into local
-   variables here.  Checks for correct semantics are in
-   cris_option_override.  */
-
-static bool
-cris_handle_option (struct gcc_options *opts,
-                   struct gcc_options *opts_set ATTRIBUTE_UNUSED,
-                   const struct cl_decoded_option *decoded,
-                   location_t loc ATTRIBUTE_UNUSED)
-{
-  size_t code = decoded->opt_index;
-
-  switch (code)
-    {
-    case OPT_metrax100:
-      opts->x_target_flags
-       |= (MASK_SVINTO
-           + MASK_ETRAX4_ADD
-           + MASK_ALIGN_BY_32);
-      break;
-
-    case OPT_mno_etrax100:
-      opts->x_target_flags
-       &= ~(MASK_SVINTO
-            + MASK_ETRAX4_ADD
-            + MASK_ALIGN_BY_32);
-      break;
-
-    case OPT_m32_bit:
-    case OPT_m32bit:
-      opts->x_target_flags
-       |= (MASK_STACK_ALIGN
-           + MASK_CONST_ALIGN
-           + MASK_DATA_ALIGN
-           + MASK_ALIGN_BY_32);
-      break;
-
-    case OPT_m16_bit:
-    case OPT_m16bit:
-      opts->x_target_flags
-       |= (MASK_STACK_ALIGN
-           + MASK_CONST_ALIGN
-           + MASK_DATA_ALIGN);
-      break;
-
-    case OPT_m8_bit:
-    case OPT_m8bit:
-      opts->x_target_flags
-       &= ~(MASK_STACK_ALIGN
-            + MASK_CONST_ALIGN
-            + MASK_DATA_ALIGN);
-      break;
-
-    default:
-      break;
-    }
-
-  return true;
-}
-
 /* The TARGET_OPTION_OVERRIDE worker.
    As is the norm, this also parses -mfoo=bar type parameters.  */
 
index 74585b5dc0c510478fb86618bf697cd24de23f52..40c39aad4740e2f1c9964dae586048946242b96f 100644 (file)
@@ -1,6 +1,6 @@
 /* FR30 specific functions.
    Copyright (C) 1998, 1999, 2000, 2001, 2002, 2004, 2005, 2007, 2008, 2009,
-   2010 Free Software Foundation, Inc.
+   2010, 2011 Free Software Foundation, Inc.
    Contributed by Cygnus Solutions.
 
    This file is part of GCC.
@@ -150,13 +150,6 @@ static int fr30_num_arg_regs (enum machine_mode, const_tree);
 #if UNITS_PER_WORD == 4
 #define WORD_ALIGN(SIZE) (((SIZE) + 3) & ~3)
 #endif
-
-/* Implement TARGET_OPTION_OPTIMIZATION_TABLE.  */
-static const struct default_options fr30_option_optimization_table[] =
-  {
-    { OPT_LEVELS_1_PLUS, OPT_fomit_frame_pointer, NULL, 1 },
-    { OPT_LEVELS_NONE, 0, NULL, 0 }
-  };
 \f
 /* Initialize the GCC target structure.  */
 #undef  TARGET_ASM_ALIGNED_HI_OP
@@ -198,12 +191,6 @@ static const struct default_options fr30_option_optimization_table[] =
 #undef TARGET_TRAMPOLINE_INIT
 #define TARGET_TRAMPOLINE_INIT fr30_trampoline_init
 
-#undef TARGET_EXCEPT_UNWIND_INFO
-#define TARGET_EXCEPT_UNWIND_INFO sjlj_except_unwind_info
-
-#undef TARGET_OPTION_OPTIMIZATION_TABLE
-#define TARGET_OPTION_OPTIMIZATION_TABLE fr30_option_optimization_table
-
 struct gcc_target targetm = TARGET_INITIALIZER;
 \f
 
index c16a9056eb8bf2ec9ea3d4a7d03a17e64b218da7..de8eac6176a66b0a19aa42f0838afb6fa88152aa 100644 (file)
@@ -400,20 +400,6 @@ static bool frv_can_eliminate                      (const int, const int);
 static void frv_conditional_register_usage     (void);
 static void frv_trampoline_init                        (rtx, tree, rtx);
 static bool frv_class_likely_spilled_p                 (reg_class_t);
-
-/* Implement TARGET_OPTION_OPTIMIZATION_TABLE.  */
-static const struct default_options frv_option_optimization_table[] =
-  {
-    { OPT_LEVELS_1_PLUS, OPT_fomit_frame_pointer, NULL, 1 },
-    { OPT_LEVELS_NONE, 0, NULL, 0 }
-  };
-\f
-/* Allow us to easily change the default for -malloc-cc.  */
-#ifndef DEFAULT_NO_ALLOC_CC
-#define MASK_DEFAULT_ALLOC_CC  MASK_ALLOC_CC
-#else
-#define MASK_DEFAULT_ALLOC_CC  0
-#endif
 \f
 /* Initialize the GCC target structure.  */
 #undef TARGET_PRINT_OPERAND
@@ -428,19 +414,8 @@ static const struct default_options frv_option_optimization_table[] =
 #define TARGET_ASM_FUNCTION_EPILOGUE frv_function_epilogue
 #undef  TARGET_ASM_INTEGER
 #define TARGET_ASM_INTEGER frv_assemble_integer
-#undef TARGET_DEFAULT_TARGET_FLAGS
-#define TARGET_DEFAULT_TARGET_FLAGS            \
-  (MASK_DEFAULT_ALLOC_CC                       \
-   | MASK_COND_MOVE                            \
-   | MASK_SCC                                  \
-   | MASK_COND_EXEC                            \
-   | MASK_VLIW_BRANCH                          \
-   | MASK_MULTI_CE                             \
-   | MASK_NESTED_CE)
 #undef TARGET_OPTION_OVERRIDE
 #define TARGET_OPTION_OVERRIDE frv_option_override
-#undef TARGET_OPTION_OPTIMIZATION_TABLE
-#define TARGET_OPTION_OPTIMIZATION_TABLE frv_option_optimization_table
 #undef TARGET_INIT_BUILTINS
 #define TARGET_INIT_BUILTINS frv_init_builtins
 #undef TARGET_EXPAND_BUILTIN
index 28c232e3bc125c673430d855b6c992f618089c5d..77fc2d2e0104313470ff7e2aa918ce1a9d7cdc81 100644 (file)
@@ -309,17 +309,6 @@ enum h8_cpu
   H8_S
 };
 
-/* Implement TARGET_OPTION_OPTIMIZATION_TABLE.  */
-
-static const struct default_options h8300_option_optimization_table[] =
-  {
-    /* Basic block reordering is only beneficial on targets with cache
-       and/or variable-cycle branches where (cycle count taken !=
-       cycle count not taken).  */
-    { OPT_LEVELS_ALL, OPT_freorder_blocks, NULL, 0 },
-    { OPT_LEVELS_NONE, 0, NULL, 0 }
-  };
-
 /* Initialize various cpu specific globals at start up.  */
 
 static void
@@ -5987,9 +5976,6 @@ h8300_trampoline_init (rtx m_tramp, tree fndecl, rtx cxt)
 #undef TARGET_LEGITIMATE_ADDRESS_P
 #define TARGET_LEGITIMATE_ADDRESS_P    h8300_legitimate_address_p
 
-#undef TARGET_DEFAULT_TARGET_FLAGS
-#define TARGET_DEFAULT_TARGET_FLAGS TARGET_DEFAULT
-
 #undef TARGET_CAN_ELIMINATE
 #define TARGET_CAN_ELIMINATE h8300_can_eliminate
 
@@ -6002,12 +5988,6 @@ 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_TABLE
-#define TARGET_OPTION_OPTIMIZATION_TABLE h8300_option_optimization_table
-
-#undef TARGET_EXCEPT_UNWIND_INFO
-#define TARGET_EXCEPT_UNWIND_INFO sjlj_except_unwind_info
-
 #undef TARGET_MODE_DEPENDENT_ADDRESS_P
 #define TARGET_MODE_DEPENDENT_ADDRESS_P h8300_mode_dependent_address_p
 
index 5643153ac39108885dc9d7d2ebcfb1d75b367619..83f39dcc78489ee6c7a2f90233391f1081c62216 100644 (file)
@@ -1,6 +1,6 @@
 /* Definitions of target machine for GCC for IA-32.
    Copyright (C) 1988, 1992, 1994, 1995, 1996, 1996, 1997, 1998, 1999,
-   2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010
+   2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011
    Free Software Foundation, Inc.
 
 This file is part of GCC.
@@ -19,6 +19,12 @@ You should have received a copy of the GNU General Public License
 along with GCC; see the file COPYING3.  If not see
 <http://www.gnu.org/licenses/>.  */
 
+/* In i386-common.c.  */
+extern bool ix86_handle_option (struct gcc_options *opts,
+                               struct gcc_options *opts_set ATTRIBUTE_UNUSED,
+                               const struct cl_decoded_option *decoded,
+                               location_t loc);
+
 /* Functions in i386.c */
 extern bool ix86_target_stack_probe (void);
 extern bool ix86_can_use_return_insn_p (void);
index 7b266b93f838b51374aed68b67f01f1a7fe18135..507d4c691ef7cd4f0be9e1269c84dbe4ac9f0688 100644 (file)
@@ -45,6 +45,7 @@ along with GCC; see the file COPYING3.  If not see
 #include "ggc.h"
 #include "target.h"
 #include "target-def.h"
+#include "common/common-target.h"
 #include "langhooks.h"
 #include "cgraph.h"
 #include "gimple.h"
@@ -2461,120 +2462,6 @@ static enum calling_abi ix86_function_abi (const_tree);
 static int ix86_tune_defaulted;
 static int ix86_arch_specified;
 
-/* Define a set of ISAs which are available when a given ISA is
-   enabled.  MMX and SSE ISAs are handled separately.  */
-
-#define OPTION_MASK_ISA_MMX_SET OPTION_MASK_ISA_MMX
-#define OPTION_MASK_ISA_3DNOW_SET \
-  (OPTION_MASK_ISA_3DNOW | OPTION_MASK_ISA_MMX_SET)
-
-#define OPTION_MASK_ISA_SSE_SET OPTION_MASK_ISA_SSE
-#define OPTION_MASK_ISA_SSE2_SET \
-  (OPTION_MASK_ISA_SSE2 | OPTION_MASK_ISA_SSE_SET)
-#define OPTION_MASK_ISA_SSE3_SET \
-  (OPTION_MASK_ISA_SSE3 | OPTION_MASK_ISA_SSE2_SET)
-#define OPTION_MASK_ISA_SSSE3_SET \
-  (OPTION_MASK_ISA_SSSE3 | OPTION_MASK_ISA_SSE3_SET)
-#define OPTION_MASK_ISA_SSE4_1_SET \
-  (OPTION_MASK_ISA_SSE4_1 | OPTION_MASK_ISA_SSSE3_SET)
-#define OPTION_MASK_ISA_SSE4_2_SET \
-  (OPTION_MASK_ISA_SSE4_2 | OPTION_MASK_ISA_SSE4_1_SET)
-#define OPTION_MASK_ISA_AVX_SET \
-  (OPTION_MASK_ISA_AVX | OPTION_MASK_ISA_SSE4_2_SET)
-#define OPTION_MASK_ISA_FMA_SET \
-  (OPTION_MASK_ISA_FMA | OPTION_MASK_ISA_AVX_SET)
-
-/* SSE4 includes both SSE4.1 and SSE4.2. -msse4 should be the same
-   as -msse4.2.  */
-#define OPTION_MASK_ISA_SSE4_SET OPTION_MASK_ISA_SSE4_2_SET
-
-#define OPTION_MASK_ISA_SSE4A_SET \
-  (OPTION_MASK_ISA_SSE4A | OPTION_MASK_ISA_SSE3_SET)
-#define OPTION_MASK_ISA_FMA4_SET \
-  (OPTION_MASK_ISA_FMA4 | OPTION_MASK_ISA_SSE4A_SET \
-   | OPTION_MASK_ISA_AVX_SET)
-#define OPTION_MASK_ISA_XOP_SET \
-  (OPTION_MASK_ISA_XOP | OPTION_MASK_ISA_FMA4_SET)
-#define OPTION_MASK_ISA_LWP_SET \
-  OPTION_MASK_ISA_LWP
-
-/* AES and PCLMUL need SSE2 because they use xmm registers */
-#define OPTION_MASK_ISA_AES_SET \
-  (OPTION_MASK_ISA_AES | OPTION_MASK_ISA_SSE2_SET)
-#define OPTION_MASK_ISA_PCLMUL_SET \
-  (OPTION_MASK_ISA_PCLMUL | OPTION_MASK_ISA_SSE2_SET)
-
-#define OPTION_MASK_ISA_ABM_SET \
-  (OPTION_MASK_ISA_ABM | OPTION_MASK_ISA_POPCNT)
-
-#define OPTION_MASK_ISA_BMI_SET OPTION_MASK_ISA_BMI
-#define OPTION_MASK_ISA_TBM_SET OPTION_MASK_ISA_TBM
-#define OPTION_MASK_ISA_POPCNT_SET OPTION_MASK_ISA_POPCNT
-#define OPTION_MASK_ISA_CX16_SET OPTION_MASK_ISA_CX16
-#define OPTION_MASK_ISA_SAHF_SET OPTION_MASK_ISA_SAHF
-#define OPTION_MASK_ISA_MOVBE_SET OPTION_MASK_ISA_MOVBE
-#define OPTION_MASK_ISA_CRC32_SET OPTION_MASK_ISA_CRC32
-
-#define OPTION_MASK_ISA_FSGSBASE_SET OPTION_MASK_ISA_FSGSBASE
-#define OPTION_MASK_ISA_RDRND_SET OPTION_MASK_ISA_RDRND
-#define OPTION_MASK_ISA_F16C_SET \
-  (OPTION_MASK_ISA_F16C | OPTION_MASK_ISA_AVX_SET)
-
-/* Define a set of ISAs which aren't available when a given ISA is
-   disabled.  MMX and SSE ISAs are handled separately.  */
-
-#define OPTION_MASK_ISA_MMX_UNSET \
-  (OPTION_MASK_ISA_MMX | OPTION_MASK_ISA_3DNOW_UNSET)
-#define OPTION_MASK_ISA_3DNOW_UNSET \
-  (OPTION_MASK_ISA_3DNOW | OPTION_MASK_ISA_3DNOW_A_UNSET)
-#define OPTION_MASK_ISA_3DNOW_A_UNSET OPTION_MASK_ISA_3DNOW_A
-
-#define OPTION_MASK_ISA_SSE_UNSET \
-  (OPTION_MASK_ISA_SSE | OPTION_MASK_ISA_SSE2_UNSET)
-#define OPTION_MASK_ISA_SSE2_UNSET \
-  (OPTION_MASK_ISA_SSE2 | OPTION_MASK_ISA_SSE3_UNSET)
-#define OPTION_MASK_ISA_SSE3_UNSET \
-  (OPTION_MASK_ISA_SSE3 \
-   | OPTION_MASK_ISA_SSSE3_UNSET \
-   | OPTION_MASK_ISA_SSE4A_UNSET )
-#define OPTION_MASK_ISA_SSSE3_UNSET \
-  (OPTION_MASK_ISA_SSSE3 | OPTION_MASK_ISA_SSE4_1_UNSET)
-#define OPTION_MASK_ISA_SSE4_1_UNSET \
-  (OPTION_MASK_ISA_SSE4_1 | OPTION_MASK_ISA_SSE4_2_UNSET)
-#define OPTION_MASK_ISA_SSE4_2_UNSET \
-  (OPTION_MASK_ISA_SSE4_2 | OPTION_MASK_ISA_AVX_UNSET )
-#define OPTION_MASK_ISA_AVX_UNSET \
-  (OPTION_MASK_ISA_AVX | OPTION_MASK_ISA_FMA_UNSET \
-   | OPTION_MASK_ISA_FMA4_UNSET | OPTION_MASK_ISA_F16C_UNSET)
-#define OPTION_MASK_ISA_FMA_UNSET OPTION_MASK_ISA_FMA
-
-/* SSE4 includes both SSE4.1 and SSE4.2.  -mno-sse4 should the same
-   as -mno-sse4.1. */
-#define OPTION_MASK_ISA_SSE4_UNSET OPTION_MASK_ISA_SSE4_1_UNSET
-
-#define OPTION_MASK_ISA_SSE4A_UNSET \
-  (OPTION_MASK_ISA_SSE4A | OPTION_MASK_ISA_FMA4_UNSET)
-
-#define OPTION_MASK_ISA_FMA4_UNSET \
-  (OPTION_MASK_ISA_FMA4 | OPTION_MASK_ISA_XOP_UNSET)
-#define OPTION_MASK_ISA_XOP_UNSET OPTION_MASK_ISA_XOP
-#define OPTION_MASK_ISA_LWP_UNSET OPTION_MASK_ISA_LWP
-
-#define OPTION_MASK_ISA_AES_UNSET OPTION_MASK_ISA_AES
-#define OPTION_MASK_ISA_PCLMUL_UNSET OPTION_MASK_ISA_PCLMUL
-#define OPTION_MASK_ISA_ABM_UNSET OPTION_MASK_ISA_ABM
-#define OPTION_MASK_ISA_BMI_UNSET OPTION_MASK_ISA_BMI
-#define OPTION_MASK_ISA_TBM_UNSET OPTION_MASK_ISA_TBM
-#define OPTION_MASK_ISA_POPCNT_UNSET OPTION_MASK_ISA_POPCNT
-#define OPTION_MASK_ISA_CX16_UNSET OPTION_MASK_ISA_CX16
-#define OPTION_MASK_ISA_SAHF_UNSET OPTION_MASK_ISA_SAHF
-#define OPTION_MASK_ISA_MOVBE_UNSET OPTION_MASK_ISA_MOVBE
-#define OPTION_MASK_ISA_CRC32_UNSET OPTION_MASK_ISA_CRC32
-
-#define OPTION_MASK_ISA_FSGSBASE_UNSET OPTION_MASK_ISA_FSGSBASE
-#define OPTION_MASK_ISA_RDRND_UNSET OPTION_MASK_ISA_RDRND
-#define OPTION_MASK_ISA_F16C_UNSET OPTION_MASK_ISA_F16C
-
 /* Vectorization library interface and handlers.  */
 static tree (*ix86_veclib_handler) (enum built_in_function, tree, tree);
 
@@ -2656,427 +2543,6 @@ ix86_using_red_zone (void)
 {
   return TARGET_RED_ZONE && !TARGET_64BIT_MS_ABI;
 }
-
-/* Implement TARGET_HANDLE_OPTION.  */
-
-static bool
-ix86_handle_option (struct gcc_options *opts,
-                   struct gcc_options *opts_set ATTRIBUTE_UNUSED,
-                   const struct cl_decoded_option *decoded,
-                   location_t loc)
-{
-  size_t code = decoded->opt_index;
-  int value = decoded->value;
-
-  switch (code)
-    {
-    case OPT_mmmx:
-      if (value)
-       {
-         opts->x_ix86_isa_flags |= OPTION_MASK_ISA_MMX_SET;
-         opts->x_ix86_isa_flags_explicit |= OPTION_MASK_ISA_MMX_SET;
-       }
-      else
-       {
-         opts->x_ix86_isa_flags &= ~OPTION_MASK_ISA_MMX_UNSET;
-         opts->x_ix86_isa_flags_explicit |= OPTION_MASK_ISA_MMX_UNSET;
-       }
-      return true;
-
-    case OPT_m3dnow:
-      if (value)
-       {
-         opts->x_ix86_isa_flags |= OPTION_MASK_ISA_3DNOW_SET;
-         opts->x_ix86_isa_flags_explicit |= OPTION_MASK_ISA_3DNOW_SET;
-       }
-      else
-       {
-         opts->x_ix86_isa_flags &= ~OPTION_MASK_ISA_3DNOW_UNSET;
-         opts->x_ix86_isa_flags_explicit |= OPTION_MASK_ISA_3DNOW_UNSET;
-       }
-      return true;
-
-    case OPT_m3dnowa:
-      return false;
-
-    case OPT_msse:
-      if (value)
-       {
-         opts->x_ix86_isa_flags |= OPTION_MASK_ISA_SSE_SET;
-         opts->x_ix86_isa_flags_explicit |= OPTION_MASK_ISA_SSE_SET;
-       }
-      else
-       {
-         opts->x_ix86_isa_flags &= ~OPTION_MASK_ISA_SSE_UNSET;
-         opts->x_ix86_isa_flags_explicit |= OPTION_MASK_ISA_SSE_UNSET;
-       }
-      return true;
-
-    case OPT_msse2:
-      if (value)
-       {
-         opts->x_ix86_isa_flags |= OPTION_MASK_ISA_SSE2_SET;
-         opts->x_ix86_isa_flags_explicit |= OPTION_MASK_ISA_SSE2_SET;
-       }
-      else
-       {
-         opts->x_ix86_isa_flags &= ~OPTION_MASK_ISA_SSE2_UNSET;
-         opts->x_ix86_isa_flags_explicit |= OPTION_MASK_ISA_SSE2_UNSET;
-       }
-      return true;
-
-    case OPT_msse3:
-      if (value)
-       {
-         opts->x_ix86_isa_flags |= OPTION_MASK_ISA_SSE3_SET;
-         opts->x_ix86_isa_flags_explicit |= OPTION_MASK_ISA_SSE3_SET;
-       }
-      else
-       {
-         opts->x_ix86_isa_flags &= ~OPTION_MASK_ISA_SSE3_UNSET;
-         opts->x_ix86_isa_flags_explicit |= OPTION_MASK_ISA_SSE3_UNSET;
-       }
-      return true;
-
-    case OPT_mssse3:
-      if (value)
-       {
-         opts->x_ix86_isa_flags |= OPTION_MASK_ISA_SSSE3_SET;
-         opts->x_ix86_isa_flags_explicit |= OPTION_MASK_ISA_SSSE3_SET;
-       }
-      else
-       {
-         opts->x_ix86_isa_flags &= ~OPTION_MASK_ISA_SSSE3_UNSET;
-         opts->x_ix86_isa_flags_explicit |= OPTION_MASK_ISA_SSSE3_UNSET;
-       }
-      return true;
-
-    case OPT_msse4_1:
-      if (value)
-       {
-         opts->x_ix86_isa_flags |= OPTION_MASK_ISA_SSE4_1_SET;
-         opts->x_ix86_isa_flags_explicit |= OPTION_MASK_ISA_SSE4_1_SET;
-       }
-      else
-       {
-         opts->x_ix86_isa_flags &= ~OPTION_MASK_ISA_SSE4_1_UNSET;
-         opts->x_ix86_isa_flags_explicit |= OPTION_MASK_ISA_SSE4_1_UNSET;
-       }
-      return true;
-
-    case OPT_msse4_2:
-      if (value)
-       {
-         opts->x_ix86_isa_flags |= OPTION_MASK_ISA_SSE4_2_SET;
-         opts->x_ix86_isa_flags_explicit |= OPTION_MASK_ISA_SSE4_2_SET;
-       }
-      else
-       {
-         opts->x_ix86_isa_flags &= ~OPTION_MASK_ISA_SSE4_2_UNSET;
-         opts->x_ix86_isa_flags_explicit |= OPTION_MASK_ISA_SSE4_2_UNSET;
-       }
-      return true;
-
-    case OPT_mavx:
-      if (value)
-       {
-         opts->x_ix86_isa_flags |= OPTION_MASK_ISA_AVX_SET;
-         opts->x_ix86_isa_flags_explicit |= OPTION_MASK_ISA_AVX_SET;
-       }
-      else
-       {
-         opts->x_ix86_isa_flags &= ~OPTION_MASK_ISA_AVX_UNSET;
-         opts->x_ix86_isa_flags_explicit |= OPTION_MASK_ISA_AVX_UNSET;
-       }
-      return true;
-
-    case OPT_mfma:
-      if (value)
-       {
-         opts->x_ix86_isa_flags |= OPTION_MASK_ISA_FMA_SET;
-         opts->x_ix86_isa_flags_explicit |= OPTION_MASK_ISA_FMA_SET;
-       }
-      else
-       {
-         opts->x_ix86_isa_flags &= ~OPTION_MASK_ISA_FMA_UNSET;
-         opts->x_ix86_isa_flags_explicit |= OPTION_MASK_ISA_FMA_UNSET;
-       }
-      return true;
-
-    case OPT_msse4:
-      opts->x_ix86_isa_flags |= OPTION_MASK_ISA_SSE4_SET;
-      opts->x_ix86_isa_flags_explicit |= OPTION_MASK_ISA_SSE4_SET;
-      return true;
-
-    case OPT_mno_sse4:
-      opts->x_ix86_isa_flags &= ~OPTION_MASK_ISA_SSE4_UNSET;
-      opts->x_ix86_isa_flags_explicit |= OPTION_MASK_ISA_SSE4_UNSET;
-      return true;
-
-    case OPT_msse4a:
-      if (value)
-       {
-         opts->x_ix86_isa_flags |= OPTION_MASK_ISA_SSE4A_SET;
-         opts->x_ix86_isa_flags_explicit |= OPTION_MASK_ISA_SSE4A_SET;
-       }
-      else
-       {
-         opts->x_ix86_isa_flags &= ~OPTION_MASK_ISA_SSE4A_UNSET;
-         opts->x_ix86_isa_flags_explicit |= OPTION_MASK_ISA_SSE4A_UNSET;
-       }
-      return true;
-
-    case OPT_mfma4:
-      if (value)
-       {
-         opts->x_ix86_isa_flags |= OPTION_MASK_ISA_FMA4_SET;
-         opts->x_ix86_isa_flags_explicit |= OPTION_MASK_ISA_FMA4_SET;
-       }
-      else
-       {
-         opts->x_ix86_isa_flags &= ~OPTION_MASK_ISA_FMA4_UNSET;
-         opts->x_ix86_isa_flags_explicit |= OPTION_MASK_ISA_FMA4_UNSET;
-       }
-      return true;
-
-   case OPT_mxop:
-      if (value)
-       {
-         opts->x_ix86_isa_flags |= OPTION_MASK_ISA_XOP_SET;
-         opts->x_ix86_isa_flags_explicit |= OPTION_MASK_ISA_XOP_SET;
-       }
-      else
-       {
-         opts->x_ix86_isa_flags &= ~OPTION_MASK_ISA_XOP_UNSET;
-         opts->x_ix86_isa_flags_explicit |= OPTION_MASK_ISA_XOP_UNSET;
-       }
-      return true;
-
-   case OPT_mlwp:
-      if (value)
-       {
-         opts->x_ix86_isa_flags |= OPTION_MASK_ISA_LWP_SET;
-         opts->x_ix86_isa_flags_explicit |= OPTION_MASK_ISA_LWP_SET;
-       }
-      else
-       {
-         opts->x_ix86_isa_flags &= ~OPTION_MASK_ISA_LWP_UNSET;
-         opts->x_ix86_isa_flags_explicit |= OPTION_MASK_ISA_LWP_UNSET;
-       }
-      return true;
-
-    case OPT_mabm:
-      if (value)
-       {
-         opts->x_ix86_isa_flags |= OPTION_MASK_ISA_ABM_SET;
-         opts->x_ix86_isa_flags_explicit |= OPTION_MASK_ISA_ABM_SET;
-       }
-      else
-       {
-         opts->x_ix86_isa_flags &= ~OPTION_MASK_ISA_ABM_UNSET;
-         opts->x_ix86_isa_flags_explicit |= OPTION_MASK_ISA_ABM_UNSET;
-       }
-      return true;
-
-    case OPT_mbmi:
-      if (value)
-       {
-         opts->x_ix86_isa_flags |= OPTION_MASK_ISA_BMI_SET;
-         opts->x_ix86_isa_flags_explicit |= OPTION_MASK_ISA_BMI_SET;
-       }
-      else
-       {
-         opts->x_ix86_isa_flags &= ~OPTION_MASK_ISA_BMI_UNSET;
-         opts->x_ix86_isa_flags_explicit |= OPTION_MASK_ISA_BMI_UNSET;
-       }
-      return true;
-
-    case OPT_mtbm:
-      if (value)
-       {
-         opts->x_ix86_isa_flags |= OPTION_MASK_ISA_TBM_SET;
-         opts->x_ix86_isa_flags_explicit |= OPTION_MASK_ISA_TBM_SET;
-       }
-      else
-       {
-         opts->x_ix86_isa_flags &= ~OPTION_MASK_ISA_TBM_UNSET;
-         opts->x_ix86_isa_flags_explicit |= OPTION_MASK_ISA_TBM_UNSET;
-       }
-      return true;
-
-    case OPT_mpopcnt:
-      if (value)
-       {
-         opts->x_ix86_isa_flags |= OPTION_MASK_ISA_POPCNT_SET;
-         opts->x_ix86_isa_flags_explicit |= OPTION_MASK_ISA_POPCNT_SET;
-       }
-      else
-       {
-         opts->x_ix86_isa_flags &= ~OPTION_MASK_ISA_POPCNT_UNSET;
-         opts->x_ix86_isa_flags_explicit |= OPTION_MASK_ISA_POPCNT_UNSET;
-       }
-      return true;
-
-    case OPT_msahf:
-      if (value)
-       {
-         opts->x_ix86_isa_flags |= OPTION_MASK_ISA_SAHF_SET;
-         opts->x_ix86_isa_flags_explicit |= OPTION_MASK_ISA_SAHF_SET;
-       }
-      else
-       {
-         opts->x_ix86_isa_flags &= ~OPTION_MASK_ISA_SAHF_UNSET;
-         opts->x_ix86_isa_flags_explicit |= OPTION_MASK_ISA_SAHF_UNSET;
-       }
-      return true;
-
-    case OPT_mcx16:
-      if (value)
-       {
-         opts->x_ix86_isa_flags |= OPTION_MASK_ISA_CX16_SET;
-         opts->x_ix86_isa_flags_explicit |= OPTION_MASK_ISA_CX16_SET;
-       }
-      else
-       {
-         opts->x_ix86_isa_flags &= ~OPTION_MASK_ISA_CX16_UNSET;
-         opts->x_ix86_isa_flags_explicit |= OPTION_MASK_ISA_CX16_UNSET;
-       }
-      return true;
-
-    case OPT_mmovbe:
-      if (value)
-       {
-         opts->x_ix86_isa_flags |= OPTION_MASK_ISA_MOVBE_SET;
-         opts->x_ix86_isa_flags_explicit |= OPTION_MASK_ISA_MOVBE_SET;
-       }
-      else
-       {
-         opts->x_ix86_isa_flags &= ~OPTION_MASK_ISA_MOVBE_UNSET;
-         opts->x_ix86_isa_flags_explicit |= OPTION_MASK_ISA_MOVBE_UNSET;
-       }
-      return true;
-
-    case OPT_mcrc32:
-      if (value)
-       {
-         opts->x_ix86_isa_flags |= OPTION_MASK_ISA_CRC32_SET;
-         opts->x_ix86_isa_flags_explicit |= OPTION_MASK_ISA_CRC32_SET;
-       }
-      else
-       {
-         opts->x_ix86_isa_flags &= ~OPTION_MASK_ISA_CRC32_UNSET;
-         opts->x_ix86_isa_flags_explicit |= OPTION_MASK_ISA_CRC32_UNSET;
-       }
-      return true;
-
-    case OPT_maes:
-      if (value)
-       {
-         opts->x_ix86_isa_flags |= OPTION_MASK_ISA_AES_SET;
-         opts->x_ix86_isa_flags_explicit |= OPTION_MASK_ISA_AES_SET;
-       }
-      else
-       {
-         opts->x_ix86_isa_flags &= ~OPTION_MASK_ISA_AES_UNSET;
-         opts->x_ix86_isa_flags_explicit |= OPTION_MASK_ISA_AES_UNSET;
-       }
-      return true;
-
-    case OPT_mpclmul:
-      if (value)
-       {
-         opts->x_ix86_isa_flags |= OPTION_MASK_ISA_PCLMUL_SET;
-         opts->x_ix86_isa_flags_explicit |= OPTION_MASK_ISA_PCLMUL_SET;
-       }
-      else
-       {
-         opts->x_ix86_isa_flags &= ~OPTION_MASK_ISA_PCLMUL_UNSET;
-         opts->x_ix86_isa_flags_explicit |= OPTION_MASK_ISA_PCLMUL_UNSET;
-       }
-      return true;
-
-    case OPT_mfsgsbase:
-      if (value)
-       {
-         opts->x_ix86_isa_flags |= OPTION_MASK_ISA_FSGSBASE_SET;
-         opts->x_ix86_isa_flags_explicit |= OPTION_MASK_ISA_FSGSBASE_SET;
-       }
-      else
-       {
-         opts->x_ix86_isa_flags &= ~OPTION_MASK_ISA_FSGSBASE_UNSET;
-         opts->x_ix86_isa_flags_explicit |= OPTION_MASK_ISA_FSGSBASE_UNSET;
-       }
-      return true;
-
-    case OPT_mrdrnd:
-      if (value)
-       {
-         opts->x_ix86_isa_flags |= OPTION_MASK_ISA_RDRND_SET;
-         opts->x_ix86_isa_flags_explicit |= OPTION_MASK_ISA_RDRND_SET;
-       }
-      else
-       {
-         opts->x_ix86_isa_flags &= ~OPTION_MASK_ISA_RDRND_UNSET;
-         opts->x_ix86_isa_flags_explicit |= OPTION_MASK_ISA_RDRND_UNSET;
-       }
-      return true;
-
-    case OPT_mf16c:
-      if (value)
-       {
-         opts->x_ix86_isa_flags |= OPTION_MASK_ISA_F16C_SET;
-         opts->x_ix86_isa_flags_explicit |= OPTION_MASK_ISA_F16C_SET;
-       }
-      else
-       {
-         opts->x_ix86_isa_flags &= ~OPTION_MASK_ISA_F16C_UNSET;
-         opts->x_ix86_isa_flags_explicit |= OPTION_MASK_ISA_F16C_UNSET;
-       }
-      return true;
-
-  /* Comes from final.c -- no real reason to change it.  */
-#define MAX_CODE_ALIGN 16
-
-    case OPT_malign_loops_:
-      warning_at (loc, 0, "-malign-loops is obsolete, use -falign-loops");
-      if (value > MAX_CODE_ALIGN)
-       error_at (loc, "-malign-loops=%d is not between 0 and %d",
-                 value, MAX_CODE_ALIGN);
-      else
-       opts->x_align_loops = 1 << value;
-      return true;
-
-    case OPT_malign_jumps_:
-      warning_at (loc, 0, "-malign-jumps is obsolete, use -falign-jumps");
-      if (value > MAX_CODE_ALIGN)
-       error_at (loc, "-malign-jumps=%d is not between 0 and %d",
-                 value, MAX_CODE_ALIGN);
-      else
-       opts->x_align_jumps = 1 << value;
-      return true;
-
-    case OPT_malign_functions_:
-      warning_at (loc, 0,
-                 "-malign-functions is obsolete, use -falign-functions");
-      if (value > MAX_CODE_ALIGN)
-       error_at (loc, "-malign-functions=%d is not between 0 and %d",
-                 value, MAX_CODE_ALIGN);
-      else
-       opts->x_align_functions = 1 << value;
-      return true;
-
-    case OPT_mbranch_cost_:
-      if (value > 5)
-       {
-         error_at (loc, "-mbranch-cost=%d is not between 0 and 5", value);
-         opts->x_ix86_branch_cost = 5;
-       }
-      return true;
-
-    default:
-      return true;
-    }
-}
 \f
 /* Return a string that documents the current -m options.  The caller is
    responsible for freeing the string.  */
@@ -5092,35 +4558,6 @@ x86_output_aligned_bss (FILE *file, tree decl ATTRIBUTE_UNUSED,
   ASM_OUTPUT_SKIP (file, size ? size : 1);
 }
 \f
-static const struct default_options ix86_option_optimization_table[] =
-  {
-    /* Turn off -fschedule-insns by default.  It tends to make the
-       problem with not enough registers even worse.  */
-#ifdef INSN_SCHEDULING
-    { OPT_LEVELS_ALL, OPT_fschedule_insns, NULL, 0 },
-#endif
-
-#ifdef SUBTARGET_OPTIMIZATION_OPTIONS
-    SUBTARGET_OPTIMIZATION_OPTIONS,
-#endif
-    { OPT_LEVELS_NONE, 0, NULL, 0 }
-  };
-
-/* Implement TARGET_OPTION_INIT_STRUCT.  */
-
-static void
-ix86_option_init_struct (struct gcc_options *opts)
-{
-  if (TARGET_MACHO)
-    /* The Darwin libraries never set errno, so we might as well
-       avoid calling them when that's the only reason we would.  */
-    opts->x_flag_errno_math = 0;
-
-  opts->x_flag_pcc_struct_return = 2;
-  opts->x_flag_asynchronous_unwind_tables = 2;
-  opts->x_flag_vect_cost_model = 1;
-}
-
 /* Decide whether we must probe the stack before any space allocation
    on this target.  It's essentially TARGET_STACK_PROBE except when
    -fstack-check causes the stack to be already probed differently.  */
@@ -9142,32 +8579,6 @@ ix86_builtin_setjmp_frame_value (void)
   return stack_realign_fp ? hard_frame_pointer_rtx : virtual_stack_vars_rtx;
 }
 
-/* On the x86 -fsplit-stack and -fstack-protector both use the same
-   field in the TCB, so they can not be used together.  */
-
-static bool
-ix86_supports_split_stack (bool report ATTRIBUTE_UNUSED,
-                          struct gcc_options *opts ATTRIBUTE_UNUSED)
-{
-  bool ret = true;
-
-#ifndef TARGET_THREAD_SPLIT_STACK_OFFSET
-  if (report)
-    error ("%<-fsplit-stack%> currently only supported on GNU/Linux");
-  ret = false;
-#else
-  if (!HAVE_GAS_CFI_PERSONALITY_DIRECTIVE)
-    {
-      if (report)
-       error ("%<-fsplit-stack%> requires "
-              "assembler support for CFI directives");
-      ret = false;
-    }
-#endif
-
-  return ret;
-}
-
 /* When using -fsplit-stack, the allocation routines set a field in
    the TCB to the bottom of the stack plus this much space, measured
    in bytes.  */
@@ -35297,21 +34708,8 @@ ix86_autovectorize_vector_sizes (void)
 #undef TARGET_ASM_FILE_START
 #define TARGET_ASM_FILE_START x86_file_start
 
-#undef TARGET_DEFAULT_TARGET_FLAGS
-#define TARGET_DEFAULT_TARGET_FLAGS    \
-  (TARGET_DEFAULT                      \
-   | TARGET_SUBTARGET_DEFAULT          \
-   | TARGET_TLS_DIRECT_SEG_REFS_DEFAULT)
-
-#undef TARGET_HANDLE_OPTION
-#define TARGET_HANDLE_OPTION ix86_handle_option
-
 #undef TARGET_OPTION_OVERRIDE
 #define TARGET_OPTION_OVERRIDE ix86_option_override
-#undef TARGET_OPTION_OPTIMIZATION_TABLE
-#define TARGET_OPTION_OPTIMIZATION_TABLE ix86_option_optimization_table
-#undef TARGET_OPTION_INIT_STRUCT
-#define TARGET_OPTION_INIT_STRUCT ix86_option_init_struct
 
 #undef TARGET_REGISTER_MOVE_COST
 #define TARGET_REGISTER_MOVE_COST ix86_register_move_cost
@@ -35412,9 +34810,6 @@ ix86_autovectorize_vector_sizes (void)
 #define TARGET_STACK_PROTECT_FAIL ix86_stack_protect_fail
 #endif
 
-#undef TARGET_SUPPORTS_SPLIT_STACK
-#define TARGET_SUPPORTS_SPLIT_STACK ix86_supports_split_stack
-
 #undef TARGET_FUNCTION_VALUE
 #define TARGET_FUNCTION_VALUE ix86_function_value
 
index a43843351a08f9be0964ac42beb6d78ae659e04f..d51006561ac38217dd037a1819d0b85e0fc60591 100644 (file)
@@ -24,7 +24,7 @@ i386.o: $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \
   $(GGC_H) $(TARGET_H) $(TARGET_DEF_H) langhooks.h $(CGRAPH_H) \
   $(TREE_GIMPLE_H) $(DWARF2_H) $(DF_H) tm-constrs.h $(PARAMS_H) \
   i386-builtin-types.inc debug.h dwarf2out.h sbitmap.h $(FIBHEAP_H) \
-  $(OPTS_H) $(DIAGNOSTIC_H)
+  $(OPTS_H) $(DIAGNOSTIC_H) $(COMMON_TARGET_H)
 
 i386-c.o: $(srcdir)/config/i386/i386-c.c \
   $(srcdir)/config/i386/i386-protos.h $(CONFIG_H) $(SYSTEM_H) coretypes.h \
index 627271e8d7d7cb069c65a63415d7ab6c5786b61e..893ed8861033c02fb35ac2814e8fad0bc3c3e11c 100644 (file)
@@ -1,5 +1,5 @@
 /* Definitions of target machine for GNU compiler for IA-64.
-   Copyright (C) 1999, 2000, 2002, 2003, 2004, 2005, 2007, 2010
+   Copyright (C) 1999, 2000, 2002, 2003, 2004, 2005, 2007, 2010, 2011
    Free Software Foundation, Inc.
 
 This file is part of GCC.
@@ -18,6 +18,9 @@ You should have received a copy of the GNU General Public License
 along with GCC; see the file COPYING3.  If not see
 <http://www.gnu.org/licenses/>.  */
 
+/* Shared between the driver and cc1.  */
+extern enum unwind_info_type ia64_except_unwind_info (struct gcc_options *);
+
 /* Functions defined in ia64.c */
 
 extern int bundling_p;
index b8ffc14debdc7f5cf8d430ef1ce326de03fa9a4b..e930028961f68eb5982fac93528749c406c874ff 100644 (file)
@@ -221,8 +221,6 @@ static int ia64_memory_move_cost (enum machine_mode mode, reg_class_t,
 static bool ia64_rtx_costs (rtx, int, int, int *, bool);
 static int ia64_unspec_may_trap_p (const_rtx, unsigned);
 static void fix_range (const char *);
-static bool ia64_handle_option (struct gcc_options *, struct gcc_options *,
-                               const struct cl_decoded_option *, location_t);
 static struct machine_function * ia64_init_machine_status (void);
 static void emit_insn_group_barriers (FILE *);
 static void emit_all_insn_group_barriers (FILE *);
@@ -253,7 +251,6 @@ static void ia64_asm_emit_except_personality (rtx);
 static void ia64_asm_init_sections (void);
 
 static enum unwind_info_type ia64_debug_unwind_info (void);
-static enum unwind_info_type ia64_except_unwind_info (struct gcc_options *);
 
 static struct bundle_state *get_free_bundle_state (void);
 static void free_bundle_state (struct bundle_state *);
@@ -348,16 +345,6 @@ static const struct attribute_spec ia64_attribute_table[] =
   { NULL,             0, 0, false, false, false, NULL, false }
 };
 
-/* Implement overriding of the optimization options.  */
-static const struct default_options ia64_option_optimization_table[] =
-  {
-    { OPT_LEVELS_1_PLUS, OPT_fomit_frame_pointer, NULL, 1 },
-#ifdef SUBTARGET_OPTIMIZATION_OPTIONS
-    SUBTARGET_OPTIMIZATION_OPTIONS,
-#endif
-    { OPT_LEVELS_NONE, 0, NULL, 0 }
-  };
-
 /* Initialize the GCC target structure.  */
 #undef TARGET_ATTRIBUTE_TABLE
 #define TARGET_ATTRIBUTE_TABLE ia64_attribute_table
@@ -390,8 +377,6 @@ static const struct default_options ia64_option_optimization_table[] =
 
 #undef TARGET_OPTION_OVERRIDE
 #define TARGET_OPTION_OVERRIDE ia64_option_override
-#undef TARGET_OPTION_OPTIMIZATION_TABLE
-#define TARGET_OPTION_OPTIMIZATION_TABLE ia64_option_optimization_table
 #undef TARGET_OPTION_DEFAULT_PARAMS
 #define TARGET_OPTION_DEFAULT_PARAMS ia64_option_default_params
 
@@ -580,8 +565,6 @@ static const struct default_options ia64_option_optimization_table[] =
 
 #undef TARGET_DEBUG_UNWIND_INFO
 #define TARGET_DEBUG_UNWIND_INFO  ia64_debug_unwind_info
-#undef TARGET_EXCEPT_UNWIND_INFO
-#define TARGET_EXCEPT_UNWIND_INFO  ia64_except_unwind_info
 
 #undef TARGET_SCALAR_MODE_SUPPORTED_P
 #define TARGET_SCALAR_MODE_SUPPORTED_P ia64_scalar_mode_supported_p
@@ -593,11 +576,6 @@ static const struct default_options ia64_option_optimization_table[] =
 #undef TARGET_RELAXED_ORDERING
 #define TARGET_RELAXED_ORDERING true
 
-#undef TARGET_DEFAULT_TARGET_FLAGS
-#define TARGET_DEFAULT_TARGET_FLAGS (TARGET_DEFAULT | TARGET_CPU_DEFAULT)
-#undef TARGET_HANDLE_OPTION
-#define TARGET_HANDLE_OPTION ia64_handle_option
-
 #undef TARGET_LEGITIMATE_CONSTANT_P
 #define TARGET_LEGITIMATE_CONSTANT_P ia64_legitimate_constant_p
 
@@ -5641,30 +5619,6 @@ fix_range (const char *const_str)
     }
 }
 
-/* Implement TARGET_HANDLE_OPTION.  */
-
-static bool
-ia64_handle_option (struct gcc_options *opts ATTRIBUTE_UNUSED,
-                   struct gcc_options *opts_set ATTRIBUTE_UNUSED,
-                   const struct cl_decoded_option *decoded,
-                   location_t loc)
-{
-  size_t code = decoded->opt_index;
-  const char *arg = decoded->arg;
-  int value = decoded->value;
-
-  switch (code)
-    {
-    case OPT_mtls_size_:
-      if (value != 14 && value != 22 && value != 64)
-       error_at (loc, "bad value %<%s%> for -mtls-size= switch", arg);
-      return true;
-
-    default:
-      return true;
-    }
-}
-
 /* Implement TARGET_OPTION_OVERRIDE.  */
 
 static void
@@ -10095,25 +10049,6 @@ ia64_debug_unwind_info (void)
 {
   return UI_TARGET;
 }
-
-/* Implement TARGET_EXCEPT_UNWIND_INFO.  */
-
-static enum unwind_info_type
-ia64_except_unwind_info (struct gcc_options *opts)
-{
-  /* Honor the --enable-sjlj-exceptions configure switch.  */
-#ifdef CONFIG_UNWIND_EXCEPTIONS
-  if (CONFIG_UNWIND_EXCEPTIONS)
-    return UI_SJLJ;
-#endif
-
-  /* For simplicity elsewhere in this file, indicate that all unwind
-     info is disabled if we're not emitting unwind tables.  */
-  if (!opts->x_flag_exceptions && !opts->x_flag_unwind_tables)
-    return UI_NONE;
-
-  return UI_TARGET;
-}
 \f
 enum ia64_builtins
 {
index aa63674c47065488d0beae4a038660ed5693d11c..7512df8564e27275206aeeb315c51099be2d60bb 100644 (file)
@@ -176,13 +176,6 @@ static void iq2000_print_operand      (FILE *, rtx, int);
 static void iq2000_print_operand_address (FILE *, rtx);
 static bool iq2000_print_operand_punct_valid_p (unsigned char code);
 
-/* Implement TARGET_OPTION_OPTIMIZATION_TABLE.  */
-static const struct default_options iq2000_option_optimization_table[] =
-  {
-    { OPT_LEVELS_1_PLUS, OPT_fomit_frame_pointer, NULL, 1 },
-    { OPT_LEVELS_NONE, 0, NULL, 0 }
-  };
-
 #undef  TARGET_INIT_BUILTINS
 #define TARGET_INIT_BUILTINS           iq2000_init_builtins
 #undef  TARGET_EXPAND_BUILTIN
@@ -191,8 +184,6 @@ static const struct default_options iq2000_option_optimization_table[] =
 #define TARGET_ASM_SELECT_RTX_SECTION  iq2000_select_rtx_section
 #undef  TARGET_OPTION_OVERRIDE
 #define TARGET_OPTION_OVERRIDE         iq2000_option_override
-#undef  TARGET_OPTION_OPTIMIZATION_TABLE
-#define TARGET_OPTION_OPTIMIZATION_TABLE iq2000_option_optimization_table
 #undef  TARGET_RTX_COSTS
 #define TARGET_RTX_COSTS               iq2000_rtx_costs
 #undef  TARGET_ADDRESS_COST
index ac368c84bac7cb2d00dc131b08b3029a08145421..551c160d6054421191e9207532cbf45529368e9b 100644 (file)
@@ -1,7 +1,7 @@
 /* Subroutines used for code generation on the Lattice Mico32 architecture.
    Contributed by Jon Beniston <jon@beniston.com>
 
-   Copyright (C) 2009, 2010 Free Software Foundation, Inc.
+   Copyright (C) 2009, 2010, 2011 Free Software Foundation, Inc.
 
    This file is part of GCC.
 
@@ -83,17 +83,8 @@ static void lm32_function_arg_advance (CUMULATIVE_ARGS * cum,
                                       const_tree type, bool named);
 static bool lm32_legitimate_constant_p (enum machine_mode, rtx);
 
-/* Implement TARGET_OPTION_OPTIMIZATION_TABLE.  */
-static const struct default_options lm32_option_optimization_table[] =
-  {
-    { OPT_LEVELS_1_PLUS, OPT_fomit_frame_pointer, NULL, 1 },
-    { OPT_LEVELS_NONE, 0, NULL, 0 }
-  };
-
 #undef TARGET_OPTION_OVERRIDE
 #define TARGET_OPTION_OVERRIDE lm32_option_override
-#undef TARGET_OPTION_OPTIMIZATION_TABLE
-#define TARGET_OPTION_OPTIMIZATION_TABLE lm32_option_optimization_table
 #undef TARGET_ADDRESS_COST
 #define TARGET_ADDRESS_COST hook_int_rtx_bool_0
 #undef TARGET_RTX_COSTS
@@ -118,8 +109,6 @@ static const struct default_options lm32_option_optimization_table[] =
 #define TARGET_CAN_ELIMINATE lm32_can_eliminate
 #undef TARGET_LEGITIMATE_ADDRESS_P
 #define TARGET_LEGITIMATE_ADDRESS_P lm32_legitimate_address_p
-#undef TARGET_EXCEPT_UNWIND_INFO
-#define TARGET_EXCEPT_UNWIND_INFO sjlj_except_unwind_info
 #undef TARGET_LEGITIMATE_CONSTANT_P
 #define TARGET_LEGITIMATE_CONSTANT_P lm32_legitimate_constant_p
 
index 3770fefb6da220b584e0715ab1b01d63167bb8f6..4084b2ab20e899125d1b8d3aa43acff56e0759ee 100644 (file)
@@ -2549,11 +2549,6 @@ m32c_address_cost (rtx addr, bool speed ATTRIBUTE_UNUSED)
 
 /* Defining the Output Assembler Language */
 
-/* The Overall Framework of an Assembler File */
-
-#undef TARGET_HAVE_NAMED_SECTIONS
-#define TARGET_HAVE_NAMED_SECTIONS true
-
 /* Output of Data */
 
 /* We may have 24 bit sizes, which is the native address size.
index 1580f47edd1368935c0306e3d73212723aa2aa73..ba1a266a9b002bfdc3b35ac77c76cbc1d43785d6 100644 (file)
@@ -56,8 +56,6 @@ static char m32r_punct_chars[256];
 #define LIT_NAME_P(NAME) ((NAME)[0] == '*' && (NAME)[1] == '.')
 
 /* Forward declaration.  */
-static bool  m32r_handle_option (struct gcc_options *, struct gcc_options *,
-                                const struct cl_decoded_option *, location_t);
 static void  m32r_option_override (void);
 static void  init_reg_tables (void);
 static void  block_move_call (rtx, rtx, rtx);
@@ -112,13 +110,6 @@ static const struct attribute_spec m32r_attribute_table[] =
     false },
   { NULL,        0, 0, false, false, false, NULL, false }
 };
-
-static const struct default_options m32r_option_optimization_table[] =
-  {
-    { OPT_LEVELS_1_PLUS, OPT_fomit_frame_pointer, NULL, 1 },
-    { OPT_LEVELS_1_PLUS, OPT_fregmove, NULL, 1 },
-    { OPT_LEVELS_NONE, 0, NULL, 0 }
-  };
 \f
 /* Initialize the GCC target structure.  */
 #undef  TARGET_ATTRIBUTE_TABLE
@@ -156,14 +147,8 @@ static const struct default_options m32r_option_optimization_table[] =
 #undef  TARGET_SCHED_ISSUE_RATE
 #define TARGET_SCHED_ISSUE_RATE m32r_issue_rate
 
-#undef  TARGET_DEFAULT_TARGET_FLAGS
-#define TARGET_DEFAULT_TARGET_FLAGS TARGET_CPU_DEFAULT
-#undef  TARGET_HANDLE_OPTION
-#define TARGET_HANDLE_OPTION m32r_handle_option
 #undef  TARGET_OPTION_OVERRIDE
 #define TARGET_OPTION_OVERRIDE m32r_option_override
-#undef  TARGET_OPTION_OPTIMIZATION_TABLE
-#define TARGET_OPTION_OPTIMIZATION_TABLE m32r_option_optimization_table
 
 #undef  TARGET_ENCODE_SECTION_INFO
 #define TARGET_ENCODE_SECTION_INFO m32r_encode_section_info
@@ -215,40 +200,8 @@ static const struct default_options m32r_option_optimization_table[] =
 #undef TARGET_LEGITIMATE_CONSTANT_P
 #define TARGET_LEGITIMATE_CONSTANT_P m32r_legitimate_constant_p
 
-#undef  TARGET_EXCEPT_UNWIND_INFO
-#define TARGET_EXCEPT_UNWIND_INFO              sjlj_except_unwind_info
-
 struct gcc_target targetm = TARGET_INITIALIZER;
 \f
-/* Implement TARGET_HANDLE_OPTION.  */
-
-static bool
-m32r_handle_option (struct gcc_options *opts,
-                   struct gcc_options *opts_set ATTRIBUTE_UNUSED,
-                   const struct cl_decoded_option *decoded,
-                   location_t loc ATTRIBUTE_UNUSED)
-{
-  size_t code = decoded->opt_index;
-  int value = decoded->value;
-
-  switch (code)
-    {
-    case OPT_m32r:
-      opts->x_target_flags &= ~(MASK_M32R2 | MASK_M32RX);
-      return true;
-
-    case OPT_mno_flush_func:
-      opts->x_m32r_cache_flush_func = NULL;
-      return true;
-
-    case OPT_mflush_trap_:
-      return value <= 15;
-
-    default:
-      return true;
-    }
-}
-
 /* Called by m32r_option_override to initialize various things.  */
 
 void
@@ -1380,10 +1333,7 @@ m32r_issue_rate (void)
 }
 \f
 /* Cost functions.  */
-
-/* Implement TARGET_HANDLE_OPTION.
-
-   Memory is 3 times as expensive as registers.
+/* Memory is 3 times as expensive as registers.
    ??? Is that the right way to look at it?  */
 
 static int
index fd27ee43a148b87251803c1c5644ea113a44d5eb..bfaa14fbd689e604ce99cd41d7e8edbaaaa646b0 100644 (file)
@@ -135,8 +135,6 @@ static int m68k_sched_first_cycle_multipass_dfa_lookahead (void);
 static bool m68k_can_eliminate (const int, const int);
 static void m68k_conditional_register_usage (void);
 static bool m68k_legitimate_address_p (enum machine_mode, rtx, bool);
-static bool m68k_handle_option (struct gcc_options *, struct gcc_options *,
-                               const struct cl_decoded_option *, location_t);
 static void m68k_option_override (void);
 static rtx find_addr_reg (rtx);
 static const char *singlemove_string (rtx *);
@@ -234,9 +232,6 @@ static bool m68k_cannot_force_const_mem (enum machine_mode mode, rtx x);
 #define TARGET_SCHED_FIRST_CYCLE_MULTIPASS_DFA_LOOKAHEAD       \
   m68k_sched_first_cycle_multipass_dfa_lookahead
 
-#undef TARGET_HANDLE_OPTION
-#define TARGET_HANDLE_OPTION m68k_handle_option
-
 #undef TARGET_OPTION_OVERRIDE
 #define TARGET_OPTION_OVERRIDE m68k_option_override
 
@@ -430,47 +425,6 @@ const char *m68k_symbolic_jump;
 enum M68K_SYMBOLIC_CALL m68k_symbolic_call_var;
 
 \f
-/* Implement TARGET_HANDLE_OPTION.  */
-
-static bool
-m68k_handle_option (struct gcc_options *opts,
-                   struct gcc_options *opts_set ATTRIBUTE_UNUSED,
-                   const struct cl_decoded_option *decoded,
-                   location_t loc)
-{
-  size_t code = decoded->opt_index;
-  const char *arg = decoded->arg;
-  int value = decoded->value;
-
-  switch (code)
-    {
-    case OPT_m68020_40:
-      opts->x_m68k_tune_option = u68020_40;
-      opts->x_m68k_cpu_option = m68020;
-      return true;
-
-    case OPT_m68020_60:
-      opts->x_m68k_tune_option = u68020_60;
-      opts->x_m68k_cpu_option = m68020;
-      return true;
-
-    case OPT_mshared_library_id_:
-      if (value > MAX_LIBRARY_ID)
-       error_at (loc, "-mshared-library-id=%s is not between 0 and %d",
-                 arg, MAX_LIBRARY_ID);
-      else
-        {
-         char *tmp;
-         asprintf (&tmp, "%d", (value * -4) - 4);
-         opts->x_m68k_library_id_string = tmp;
-       }
-      return true;
-
-    default:
-      return true;
-    }
-}
-
 /* Implement TARGET_OPTION_OVERRIDE.  */
 
 static void
index 32ff5fddf96eda9de8563d03451e53e2ff940e6d..ff6e6804c6c1ea8a9043606be93785e2de94b20c 100644 (file)
@@ -1,6 +1,6 @@
 /* Output routines for Motorola MCore processor
    Copyright (C) 1993, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2007, 2008,
-   2009, 2010 Free Software Foundation, Inc.
+   2009, 2010, 2011 Free Software Foundation, Inc.
 
    This file is part of GCC.
 
@@ -152,23 +152,6 @@ static const struct attribute_spec mcore_attribute_table[] =
     false },
   { NULL,        0, 0, false, false, false, NULL, false }
 };
-
-/* 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 const struct default_options mcore_option_optimization_table[] =
-  {
-    { OPT_LEVELS_1_PLUS, OPT_ffunction_cse, NULL, 0 },
-    { OPT_LEVELS_1_PLUS, OPT_fomit_frame_pointer, NULL, 1 },
-    { OPT_LEVELS_ALL, OPT_fcaller_saves, NULL, 0 },
-    { OPT_LEVELS_ALL, OPT_fschedule_insns, NULL, 0 },
-    { OPT_LEVELS_ALL, OPT_fschedule_insns2, NULL, 0 },
-    { OPT_LEVELS_SIZE, OPT_mhardlit, NULL, 0 },
-    { OPT_LEVELS_NONE, 0, NULL, 0 }
-  };
 \f
 /* Initialize the GCC target structure.  */
 #undef  TARGET_ASM_EXTERNAL_LIBCALL
@@ -199,8 +182,6 @@ static const struct default_options mcore_option_optimization_table[] =
 #define TARGET_ASM_UNIQUE_SECTION      mcore_unique_section
 #undef  TARGET_ASM_FUNCTION_RODATA_SECTION
 #define TARGET_ASM_FUNCTION_RODATA_SECTION default_no_function_rodata_section
-#undef  TARGET_DEFAULT_TARGET_FLAGS
-#define TARGET_DEFAULT_TARGET_FLAGS    TARGET_DEFAULT
 #undef  TARGET_ENCODE_SECTION_INFO
 #define TARGET_ENCODE_SECTION_INFO     mcore_encode_section_info
 #undef  TARGET_STRIP_NAME_ENCODING
@@ -242,11 +223,6 @@ static const struct default_options mcore_option_optimization_table[] =
 
 #undef TARGET_OPTION_OVERRIDE
 #define TARGET_OPTION_OVERRIDE mcore_option_override
-#undef TARGET_OPTION_OPTIMIZATION_TABLE
-#define TARGET_OPTION_OPTIMIZATION_TABLE mcore_option_optimization_table
-
-#undef TARGET_EXCEPT_UNWIND_INFO
-#define TARGET_EXCEPT_UNWIND_INFO sjlj_except_unwind_info
 
 #undef TARGET_LEGITIMATE_CONSTANT_P
 #define TARGET_LEGITIMATE_CONSTANT_P mcore_legitimate_constant_p
index 9b185994a18157f37ed4704a34614909e611f542..81d902db2e99d0eb2a2f2cfdc4dc46433ad57013 100644 (file)
@@ -222,8 +222,6 @@ static rtx mep_function_arg (CUMULATIVE_ARGS *, enum machine_mode,
 static void mep_function_arg_advance (CUMULATIVE_ARGS *, enum machine_mode,
                                      const_tree, bool);
 static bool mep_vector_mode_supported_p (enum machine_mode);
-static bool mep_handle_option (struct gcc_options *, struct gcc_options *,
-                              const struct cl_decoded_option *, location_t);
 static rtx  mep_allocate_initial_value (rtx);
 static void mep_asm_init_sections (void);
 static int mep_comp_type_attributes (const_tree, const_tree);
@@ -296,21 +294,6 @@ mep_conditional_register_usage (void)
     global_regs[i] = 1;
 }
 
-
-static const struct default_options mep_option_optimization_table[] =
-  {
-    /* The first scheduling pass often increases register pressure and
-       tends to result in more spill code.  Only run it when
-       specifically asked.  */
-    { OPT_LEVELS_ALL, OPT_fschedule_insns, NULL, 0 },
-
-    /* Using $fp doesn't gain us much, even when debugging is
-       important.  */
-    { OPT_LEVELS_ALL, OPT_fomit_frame_pointer, NULL, 1 },
-
-    { OPT_LEVELS_NONE, 0, NULL, 0 }
-  };
-
 static void
 mep_option_override (void)
 {
@@ -7312,45 +7295,6 @@ mep_address_cost (rtx addr ATTRIBUTE_UNUSED, bool ATTRIBUTE_UNUSED speed_p)
   return 1;
 }
 
-static bool
-mep_handle_option (struct gcc_options *opts,
-                  struct gcc_options *opts_set ATTRIBUTE_UNUSED,
-                  const struct cl_decoded_option *decoded,
-                  location_t loc ATTRIBUTE_UNUSED)
-{
-  size_t code = decoded->opt_index;
-
-  switch (code)
-    {
-    case OPT_mall_opts:
-      opts->x_target_flags |= MEP_ALL_OPTS;
-      break;
-
-    case OPT_mno_opts:
-      opts->x_target_flags &= ~ MEP_ALL_OPTS;
-      break;
-
-    case OPT_mcop64:
-      opts->x_target_flags |= MASK_COP;
-      opts->x_target_flags |= MASK_64BIT_CR_REGS;
-      break;
-
-    case OPT_mivc2:
-      opts->x_target_flags |= MASK_COP;
-      opts->x_target_flags |= MASK_64BIT_CR_REGS;
-      opts->x_target_flags |= MASK_VLIW;
-      opts->x_target_flags |= MASK_OPT_VL64;
-      opts->x_target_flags |= MASK_IVC2;
-
-      /* Remaining handling of this option deferred.  */
-      break;
-
-    default:
-      break;
-    }
-  return TRUE;
-}
-
 static void
 mep_asm_init_sections (void)
 {
@@ -7450,14 +7394,8 @@ mep_asm_init_sections (void)
 #define TARGET_FUNCTION_ARG_ADVANCE     mep_function_arg_advance
 #undef  TARGET_VECTOR_MODE_SUPPORTED_P
 #define TARGET_VECTOR_MODE_SUPPORTED_P mep_vector_mode_supported_p
-#undef  TARGET_HANDLE_OPTION
-#define TARGET_HANDLE_OPTION            mep_handle_option
 #undef  TARGET_OPTION_OVERRIDE
 #define TARGET_OPTION_OVERRIDE         mep_option_override
-#undef  TARGET_OPTION_OPTIMIZATION_TABLE
-#define TARGET_OPTION_OPTIMIZATION_TABLE       mep_option_optimization_table
-#undef  TARGET_DEFAULT_TARGET_FLAGS
-#define TARGET_DEFAULT_TARGET_FLAGS    TARGET_DEFAULT
 #undef  TARGET_ALLOCATE_INITIAL_VALUE
 #define TARGET_ALLOCATE_INITIAL_VALUE   mep_allocate_initial_value
 #undef  TARGET_ASM_INIT_SECTIONS
index 1cec425b15d8abc9946e67976c7974d7f52ca772..223d5f634ef15d71b08a7aff31928c2eeaae5f6a 100644 (file)
@@ -1416,13 +1416,6 @@ microblaze_option_override (void)
     }
 }
 
-/* Implement TARGET_OPTION_OPTIMIZATION_TABLE.  */
-static const struct default_options microblaze_option_optimization_table[] =
-  {
-    { OPT_LEVELS_1_PLUS, OPT_fomit_frame_pointer, NULL, 1 },
-    { OPT_LEVELS_NONE, 0, NULL, 0 }
-  };
-
 /* Return true if FUNC is an interrupt function as specified
    by the "interrupt_handler" attribute.  */
 
@@ -2996,9 +2989,6 @@ microblaze_legitimate_constant_p (enum machine_mode mode, rtx x)
 #define TARGET_ASM_FUNCTION_END_PROLOGUE \
                                         microblaze_function_end_prologue
 
-#undef TARGET_DEFAULT_TARGET_FLAGS
-#define TARGET_DEFAULT_TARGET_FLAGS    TARGET_DEFAULT
-
 #undef TARGET_ARG_PARTIAL_BYTES
 #define TARGET_ARG_PARTIAL_BYTES       function_arg_partial_bytes
 
@@ -3044,12 +3034,6 @@ microblaze_legitimate_constant_p (enum machine_mode mode, rtx x)
 #undef  TARGET_OPTION_OVERRIDE
 #define TARGET_OPTION_OVERRIDE         microblaze_option_override 
 
-#undef  TARGET_OPTION_OPTIMIZATION_TABLE
-#define TARGET_OPTION_OPTIMIZATION_TABLE microblaze_option_optimization_table
-
-#undef TARGET_EXCEPT_UNWIND_INFO
-#define TARGET_EXCEPT_UNWIND_INFO  sjlj_except_unwind_info
-
 #undef TARGET_LEGITIMATE_CONSTANT_P
 #define TARGET_LEGITIMATE_CONSTANT_P microblaze_legitimate_constant_p
 
index 39042386930c00037e31defe2ee9b19a23ef8eae..609d32068b427286bb8aa6be007c2dec7533c40b 100644 (file)
@@ -15302,27 +15302,6 @@ mips_set_tune (const struct mips_cpu_info *info)
     }
 }
 
-/* Implement TARGET_HANDLE_OPTION.  */
-
-static bool
-mips_handle_option (struct gcc_options *opts,
-                   struct gcc_options *opts_set ATTRIBUTE_UNUSED,
-                   const struct cl_decoded_option *decoded,
-                   location_t loc ATTRIBUTE_UNUSED)
-{
-  size_t code = decoded->opt_index;
-
-  switch (code)
-    {
-    case OPT_mno_flush_func:
-      opts->x_mips_cache_flush_func = NULL;
-      return true;
-
-    default:
-      return true;
-    }
-}
-
 /* Implement TARGET_OPTION_OVERRIDE.  */
 
 static void
@@ -15697,13 +15676,6 @@ mips_option_override (void)
   mips_set_mips16_mode (false);
 }
 
-/* Implement TARGET_OPTION_OPTIMIZATION_TABLE.  */
-static const struct default_options mips_option_optimization_table[] =
-  {
-    { OPT_LEVELS_1_PLUS, OPT_fomit_frame_pointer, NULL, 1 },
-    { OPT_LEVELS_NONE, 0, NULL, 0 }
-  };
-
 /* Swap the register information for registers I and I + 1, which
    currently have the wrong endianness.  Note that the registers'
    fixedness and call-clobberedness might have been set on the
@@ -16216,8 +16188,6 @@ mips_shift_truncation_mask (enum machine_mode mode)
 
 #undef TARGET_OPTION_OVERRIDE
 #define TARGET_OPTION_OVERRIDE mips_option_override
-#undef TARGET_OPTION_OPTIMIZATION_TABLE
-#define TARGET_OPTION_OPTIMIZATION_TABLE mips_option_optimization_table
 
 #undef TARGET_LEGITIMIZE_ADDRESS
 #define TARGET_LEGITIMIZE_ADDRESS mips_legitimize_address
@@ -16254,17 +16224,6 @@ mips_shift_truncation_mask (enum machine_mode mode)
 #define TARGET_SMALL_REGISTER_CLASSES_FOR_MODE_P \
   mips_small_register_classes_for_mode_p
 
-#undef TARGET_DEFAULT_TARGET_FLAGS
-#define TARGET_DEFAULT_TARGET_FLAGS            \
-  (TARGET_DEFAULT                              \
-   | TARGET_CPU_DEFAULT                                \
-   | TARGET_ENDIAN_DEFAULT                     \
-   | TARGET_FP_EXCEPTIONS_DEFAULT              \
-   | MASK_CHECK_ZERO_DIV                       \
-   | MASK_FUSED_MADD)
-#undef TARGET_HANDLE_OPTION
-#define TARGET_HANDLE_OPTION mips_handle_option
-
 #undef TARGET_FUNCTION_OK_FOR_SIBCALL
 #define TARGET_FUNCTION_OK_FOR_SIBCALL mips_function_ok_for_sibcall
 
index 80f0d8439a48cca8561420284e16ee91d39857fd..53e9c91b155a180057f56232ec46985e1917e441 100644 (file)
@@ -161,15 +161,6 @@ static void mmix_asm_trampoline_template (FILE *);
 static void mmix_trampoline_init (rtx, tree, rtx);
 static void mmix_conditional_register_usage (void);
 
-/* TARGET_OPTION_OPTIMIZATION_TABLE.  */
-
-static const struct default_options mmix_option_optimization_table[] =
-  {
-    { OPT_LEVELS_1_PLUS, OPT_fregmove, NULL, 1 },
-    { OPT_LEVELS_2_PLUS, OPT_fomit_frame_pointer, NULL, 1 },
-    { OPT_LEVELS_NONE, 0, NULL, 0 }
-  };
-
 /* Target structure macros.  Listed by node.  See `Using and Porting GCC'
    for a general description.  */
 
@@ -248,8 +239,6 @@ static const struct default_options mmix_option_optimization_table[] =
 #define TARGET_PASS_BY_REFERENCE mmix_pass_by_reference
 #undef TARGET_CALLEE_COPIES
 #define TARGET_CALLEE_COPIES hook_bool_CUMULATIVE_ARGS_mode_tree_bool_true
-#undef TARGET_DEFAULT_TARGET_FLAGS
-#define TARGET_DEFAULT_TARGET_FLAGS TARGET_DEFAULT
 
 #undef TARGET_LEGITIMATE_ADDRESS_P
 #define TARGET_LEGITIMATE_ADDRESS_P    mmix_legitimate_address_p
@@ -266,8 +255,6 @@ static const struct default_options mmix_option_optimization_table[] =
 
 #undef TARGET_OPTION_OVERRIDE
 #define TARGET_OPTION_OVERRIDE mmix_option_override
-#undef TARGET_OPTION_OPTIMIZATION_TABLE
-#define TARGET_OPTION_OPTIMIZATION_TABLE mmix_option_optimization_table
 
 struct gcc_target targetm = TARGET_INITIALIZER;
 
index f9052d55541b72b44388e1276c3475a766b916c3..1dba8ec88aad759ba12e2fe1f322c64359a07727 100644 (file)
@@ -68,13 +68,6 @@ enum processor_type mn10300_tune_cpu = PROCESSOR_DEFAULT;
                                || df_regs_ever_live_p (16)     \
                                || df_regs_ever_live_p (17)))
 
-/* Implement TARGET_OPTION_OPTIMIZATION_TABLE.  */
-static const struct default_options mn10300_option_optimization_table[] =
-  {
-    { OPT_LEVELS_1_PLUS, OPT_fomit_frame_pointer, NULL, 1 },
-    { OPT_LEVELS_NONE, 0, NULL, 0 }
-  };
-
 #define CC_FLAG_Z      1
 #define CC_FLAG_N      2
 #define CC_FLAG_C      4
@@ -83,38 +76,6 @@ static const struct default_options mn10300_option_optimization_table[] =
 static int cc_flags_for_mode(enum machine_mode);
 static int cc_flags_for_code(enum rtx_code);
 \f
-/* Implement TARGET_HANDLE_OPTION.  */
-
-static bool
-mn10300_handle_option (struct gcc_options *opts,
-                      struct gcc_options *opts_set ATTRIBUTE_UNUSED,
-                      const struct cl_decoded_option *decoded,
-                      location_t loc ATTRIBUTE_UNUSED)
-{
-  size_t code = decoded->opt_index;
-  int value = decoded->value;
-
-  switch (code)
-    {
-    case OPT_mam33:
-      opts->x_mn10300_processor = value ? PROCESSOR_AM33 : PROCESSOR_MN10300;
-      return true;
-
-    case OPT_mam33_2:
-      opts->x_mn10300_processor = (value
-                                  ? PROCESSOR_AM33_2
-                                  : MIN (PROCESSOR_AM33, PROCESSOR_DEFAULT));
-      return true;
-
-    case OPT_mam34:
-      opts->x_mn10300_processor = (value ? PROCESSOR_AM34 : PROCESSOR_DEFAULT);
-      return true;
-
-    default:
-      return true;
-    }
-}
-
 /* Implement TARGET_OPTION_OVERRIDE.  */
 
 static void
@@ -3320,9 +3281,6 @@ mn10300_reorg (void)
 #undef  TARGET_MACHINE_DEPENDENT_REORG
 #define TARGET_MACHINE_DEPENDENT_REORG mn10300_reorg
 
-#undef  TARGET_EXCEPT_UNWIND_INFO
-#define TARGET_EXCEPT_UNWIND_INFO sjlj_except_unwind_info
-
 #undef  TARGET_ASM_ALIGNED_HI_OP
 #define TARGET_ASM_ALIGNED_HI_OP "\t.hword\t"
 
@@ -3346,14 +3304,8 @@ mn10300_reorg (void)
 #undef TARGET_ASM_OUTPUT_ADDR_CONST_EXTRA
 #define TARGET_ASM_OUTPUT_ADDR_CONST_EXTRA mn10300_asm_output_addr_const_extra
 
-#undef  TARGET_DEFAULT_TARGET_FLAGS
-#define TARGET_DEFAULT_TARGET_FLAGS MASK_MULT_BUG | MASK_PTR_A0D0 | MASK_ALLOW_LIW | MASK_ALLOW_SETLB
-#undef  TARGET_HANDLE_OPTION
-#define TARGET_HANDLE_OPTION mn10300_handle_option
 #undef  TARGET_OPTION_OVERRIDE
 #define TARGET_OPTION_OVERRIDE mn10300_option_override
-#undef  TARGET_OPTION_OPTIMIZATION_TABLE
-#define TARGET_OPTION_OPTIMIZATION_TABLE mn10300_option_optimization_table
 
 #undef  TARGET_ENCODE_SECTION_INFO
 #define TARGET_ENCODE_SECTION_INFO mn10300_encode_section_info
index e512a33c0700152b19803229c9252a347c3f731a..b358fc3ad5fa63193529c7f6f5b223603eecd6e9 100644 (file)
@@ -45,6 +45,7 @@ along with GCC; see the file COPYING3.  If not see
 #include "predict.h"
 #include "tm_p.h"
 #include "target.h"
+#include "common/common-target.h"
 #include "target-def.h"
 #include "langhooks.h"
 #include "df.h"
@@ -88,8 +89,6 @@ hppa_fpstore_bypass_p (rtx out_insn, rtx in_insn)
 static void pa_option_override (void);
 static void copy_reg_pointer (rtx, rtx);
 static void fix_range (const char *);
-static bool pa_handle_option (struct gcc_options *, struct gcc_options *,
-                             const struct cl_decoded_option *, location_t);
 static int hppa_register_move_cost (enum machine_mode mode, reg_class_t,
                                    reg_class_t);
 static int hppa_address_cost (rtx, bool);
@@ -224,21 +223,11 @@ struct GTY(()) deferred_plabel
 static GTY((length ("n_deferred_plabels"))) struct deferred_plabel *
   deferred_plabels;
 static size_t n_deferred_plabels = 0;
-
-/* Implement TARGET_OPTION_OPTIMIZATION_TABLE.  */
-static const struct default_options pa_option_optimization_table[] =
-  {
-    { OPT_LEVELS_1_PLUS, OPT_fomit_frame_pointer, NULL, 1 },
-    { OPT_LEVELS_NONE, 0, NULL, 0 }
-  };
-
 \f
 /* Initialize the GCC target structure.  */
 
 #undef TARGET_OPTION_OVERRIDE
 #define TARGET_OPTION_OVERRIDE pa_option_override
-#undef TARGET_OPTION_OPTIMIZATION_TABLE
-#define TARGET_OPTION_OPTIMIZATION_TABLE pa_option_optimization_table
 
 #undef TARGET_ASM_ALIGNED_HI_OP
 #define TARGET_ASM_ALIGNED_HI_OP "\t.half\t"
@@ -310,11 +299,6 @@ static const struct default_options pa_option_optimization_table[] =
 #define TARGET_ASM_DESTRUCTOR pa_asm_out_destructor
 #endif
 
-#undef TARGET_DEFAULT_TARGET_FLAGS
-#define TARGET_DEFAULT_TARGET_FLAGS (TARGET_DEFAULT | TARGET_CPU_DEFAULT)
-#undef TARGET_HANDLE_OPTION
-#define TARGET_HANDLE_OPTION pa_handle_option
-
 #undef TARGET_INIT_BUILTINS
 #define TARGET_INIT_BUILTINS pa_init_builtins
 
@@ -476,41 +460,6 @@ fix_range (const char *const_str)
     target_flags |= MASK_DISABLE_FPREGS;
 }
 
-/* Implement TARGET_HANDLE_OPTION.  */
-
-static bool
-pa_handle_option (struct gcc_options *opts,
-                 struct gcc_options *opts_set ATTRIBUTE_UNUSED,
-                 const struct cl_decoded_option *decoded,
-                 location_t loc ATTRIBUTE_UNUSED)
-{
-  size_t code = decoded->opt_index;
-
-  switch (code)
-    {
-    case OPT_mnosnake:
-    case OPT_mpa_risc_1_0:
-    case OPT_march_1_0:
-      opts->x_target_flags &= ~(MASK_PA_11 | MASK_PA_20);
-      return true;
-
-    case OPT_msnake:
-    case OPT_mpa_risc_1_1:
-    case OPT_march_1_1:
-      opts->x_target_flags &= ~MASK_PA_20;
-      opts->x_target_flags |= MASK_PA_11;
-      return true;
-
-    case OPT_mpa_risc_2_0:
-    case OPT_march_2_0:
-      opts->x_target_flags |= MASK_PA_11 | MASK_PA_20;
-      return true;
-
-    default:
-      return true;
-    }
-}
-
 /* Implement the TARGET_OPTION_OVERRIDE hook.  */
 
 static void
@@ -538,7 +487,7 @@ pa_option_override (void)
      call frame information.  There is no benefit in using this optimization
      on PA8000 and later processors.  */
   if (pa_cpu >= PROCESSOR_8000
-      || (targetm.except_unwind_info (&global_options) == UI_DWARF2
+      || (targetm_common.except_unwind_info (&global_options) == UI_DWARF2
          && flag_exceptions)
       || flag_unwind_tables)
     target_flags &= ~MASK_JUMP_IN_DELAY;
@@ -8205,7 +8154,7 @@ pa_asm_output_mi_thunk (FILE *file, tree thunk_fndecl, HOST_WIDE_INT delta,
        && !(flag_pic && TREE_PUBLIC (function))
        && (TARGET_GAS || last_address < 262132))
       || (!TARGET_LONG_CALLS && !TARGET_SOM && !TARGET_PORTABLE_RUNTIME
-         && ((targetm.have_named_sections
+         && ((targetm_common.have_named_sections
               && DECL_SECTION_NAME (thunk_fndecl) != NULL
               /* The GNU 64-bit linker has rather poor stub management.
                  So, we use a long branch from thunks that aren't in
@@ -8216,11 +8165,12 @@ pa_asm_output_mi_thunk (FILE *file, tree thunk_fndecl, HOST_WIDE_INT delta,
                   || ((DECL_SECTION_NAME (thunk_fndecl)
                        == DECL_SECTION_NAME (function))
                       && last_address < 262132)))
-             || (targetm.have_named_sections
+             || (targetm_common.have_named_sections
                  && DECL_SECTION_NAME (thunk_fndecl) == NULL
                  && DECL_SECTION_NAME (function) == NULL
                  && last_address < 262132)
-             || (!targetm.have_named_sections && last_address < 262132))))
+             || (!targetm_common.have_named_sections
+                 && last_address < 262132))))
     {
       if (!val_14)
        output_asm_insn ("addil L'%2,%%r26", xoperands);
@@ -10264,7 +10214,7 @@ pa_function_section (tree decl, enum node_frequency freq,
                     bool startup, bool exit)
 {
   /* Put functions in text section if target doesn't have named sections.  */
-  if (!targetm.have_named_sections)
+  if (!targetm_common.have_named_sections)
     return text_section;
 
   /* Force nested functions into the same section as the containing
index fc0c92b8d02e700473125ac6cafb58f9340a5265..a3a550b02d375d58c1fb97b3912d39b5b3c2f384 100644 (file)
@@ -139,9 +139,6 @@ decode_pdp11_d (const struct real_format *fmt ATTRIBUTE_UNUSED,
 /* This is where the condition code register lives.  */
 /* rtx cc0_reg_rtx; - no longer needed? */
 
-static bool pdp11_handle_option (struct gcc_options *, struct gcc_options *,
-                                const struct cl_decoded_option *, location_t);
-static void pdp11_option_init_struct (struct gcc_options *);
 static const char *singlemove_string (rtx *);
 static bool pdp11_assemble_integer (rtx, unsigned int, int);
 static void pdp11_output_function_prologue (FILE *, HOST_WIDE_INT);
@@ -158,14 +155,6 @@ static void pdp11_function_arg_advance (CUMULATIVE_ARGS *,
                                        enum machine_mode, const_tree, bool);
 static void pdp11_conditional_register_usage (void);
 static bool pdp11_legitimate_constant_p (enum machine_mode, rtx);
-
-/* Implement TARGET_OPTION_OPTIMIZATION_TABLE.  */
-
-static const struct default_options pdp11_option_optimization_table[] =
-  {
-    { OPT_LEVELS_3_PLUS, OPT_fomit_frame_pointer, NULL, 1 },
-    { OPT_LEVELS_NONE, 0, NULL, 0 }
-  };
 \f
 /* Initialize the GCC target structure.  */
 #undef TARGET_ASM_BYTE_OP
@@ -187,16 +176,6 @@ static const struct default_options pdp11_option_optimization_table[] =
 #undef TARGET_ASM_CLOSE_PAREN
 #define TARGET_ASM_CLOSE_PAREN "]"
 
-#undef TARGET_DEFAULT_TARGET_FLAGS
-#define TARGET_DEFAULT_TARGET_FLAGS \
-  (MASK_FPU | MASK_45 | TARGET_UNIX_ASM_DEFAULT)
-#undef TARGET_HANDLE_OPTION
-#define TARGET_HANDLE_OPTION pdp11_handle_option
-#undef TARGET_OPTION_OPTIMIZATION_TABLE
-#define TARGET_OPTION_OPTIMIZATION_TABLE pdp11_option_optimization_table
-#undef TARGET_OPTION_INIT_STRUCT
-#define TARGET_OPTION_INIT_STRUCT pdp11_option_init_struct
-
 #undef TARGET_RTX_COSTS
 #define TARGET_RTX_COSTS pdp11_rtx_costs
 
@@ -248,37 +227,6 @@ static const struct default_options pdp11_option_optimization_table[] =
 #undef  TARGET_LEGITIMATE_CONSTANT_P
 #define TARGET_LEGITIMATE_CONSTANT_P pdp11_legitimate_constant_p
 \f
-/* Implement TARGET_HANDLE_OPTION.  */
-
-static bool
-pdp11_handle_option (struct gcc_options *opts,
-                    struct gcc_options *opts_set ATTRIBUTE_UNUSED,
-                    const struct cl_decoded_option *decoded,
-                    location_t loc ATTRIBUTE_UNUSED)
-{
-  size_t code = decoded->opt_index;
-
-  switch (code)
-    {
-    case OPT_m10:
-      opts->x_target_flags &= ~(MASK_40 | MASK_45);
-      return true;
-
-    default:
-      return true;
-    }
-}
-
-/* Implement TARGET_OPTION_INIT_STRUCT.  */
-
-static void
-pdp11_option_init_struct (struct gcc_options *opts)
-{
-  opts->x_flag_finite_math_only = 0;
-  opts->x_flag_trapping_math = 0;
-  opts->x_flag_signaling_nans = 0;
-}
-
 /*
    stream is a stdio stream to output the code to.
    size is an int: how many units of temporary storage to allocate.
index f755020b2f6bcf396d24367d5da9c335cf8f08d1..7c910fbaa279fa5de680efb63a11731fb9671c5f 100644 (file)
@@ -1,5 +1,5 @@
 /* Subroutines used for code generation on picoChip processors.
-   Copyright (C) 2001, 2008, 2009, 2010   Free Software Foundation, Inc.
+   Copyright (C) 2001, 2008, 2009, 2010, 2011   Free Software Foundation, Inc.
    Contributed by Picochip Ltd. (http://www.picochip.com)
    Maintained by Daniel Towner (daniel.towner@picochip.com) and
    Hariharan Sandanagobalane (hariharan@picochip.com)
@@ -192,13 +192,6 @@ static struct recog_data picochip_saved_recog_data;
 /* Determine which ALU to use for the instruction in
    picochip_current_prescan_insn. */
 static char picochip_get_vliw_alu_id (void);
-
-/* Implement TARGET_OPTION_OPTIMIZATION_TABLE.  */
-static const struct default_options picochip_option_optimization_table[] =
-  {
-    { OPT_LEVELS_1_PLUS, OPT_fomit_frame_pointer, NULL, 1 },
-    { OPT_LEVELS_NONE, 0, NULL, 0 }
-  };
 \f
 /* Initialize the GCC target structure.  */
 
@@ -250,9 +243,6 @@ static const struct default_options picochip_option_optimization_table[] =
 #undef TARGET_ASM_NAMED_SECTION
 #define TARGET_ASM_NAMED_SECTION picochip_asm_named_section
 
-#undef TARGET_HAVE_NAMED_SECTIONS
-#define TARGET_HAVE_NAMED_SECTIONS 1
-
 #undef TARGET_HAVE_SWITCHABLE_BSS_SECTIONS
 #define TARGET_HAVE_SWITCHABLE_BSS_SECTIONS 1
 
@@ -330,12 +320,6 @@ static const struct default_options picochip_option_optimization_table[] =
 #undef TARGET_OVERRIDE_OPTIONS_AFTER_CHANGE
 #define TARGET_OVERRIDE_OPTIONS_AFTER_CHANGE picochip_option_override
 
-#undef TARGET_OPTION_OPTIMIZATION_TABLE
-#define TARGET_OPTION_OPTIMIZATION_TABLE picochip_option_optimization_table
-
-#undef TARGET_EXCEPT_UNWIND_INFO
-#define TARGET_EXCEPT_UNWIND_INFO sjlj_except_unwind_info
-
 /* The 2nd scheduling pass option is switched off, and a machine
    dependent reorganisation ensures that it is run later on, after the
    second jump optimisation.  */
index 4827c26f19d7901b501a6fdaf4a2c45da2207be2..a6c9f5e5bd10ef942f396651539c8af21578ff98 100644 (file)
@@ -48,6 +48,7 @@
 #include "tm_p.h"
 #include "target.h"
 #include "target-def.h"
+#include "common/common-target.h"
 #include "langhooks.h"
 #include "reload.h"
 #include "cfglayout.h"
@@ -1044,11 +1045,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_init_struct (struct gcc_options *);
 static void rs6000_option_default_params (void);
-static bool rs6000_handle_option (struct gcc_options *, struct gcc_options *,
-                                 const struct cl_decoded_option *,
-                                 location_t);
 static int rs6000_loop_align_max_skip (rtx);
 static int first_altivec_reg_to_save (void);
 static unsigned int compute_vrsave_mask (void);
@@ -1290,13 +1287,6 @@ static const struct attribute_spec rs6000_attribute_table[] =
 #endif
   { NULL,        0, 0, false, false, false, NULL, false }
 };
-
-/* Implement TARGET_OPTION_OPTIMIZATION_TABLE.  */
-static const struct default_options rs6000_option_optimization_table[] =
-  {
-    { OPT_LEVELS_1_PLUS, OPT_fomit_frame_pointer, NULL, 1 },
-    { OPT_LEVELS_NONE, 0, NULL, 0 }
-  };
 \f
 #ifndef MASK_STRICT_ALIGN
 #define MASK_STRICT_ALIGN 0
@@ -1532,32 +1522,19 @@ static const struct default_options rs6000_option_optimization_table[] =
 #undef TARGET_INVALID_ARG_FOR_UNPROTOTYPED_FN
 #define TARGET_INVALID_ARG_FOR_UNPROTOTYPED_FN invalid_arg_for_unprototyped_fn
 
-#undef TARGET_HANDLE_OPTION
-#define TARGET_HANDLE_OPTION rs6000_handle_option
-
 #undef TARGET_ASM_LOOP_ALIGN_MAX_SKIP
 #define TARGET_ASM_LOOP_ALIGN_MAX_SKIP rs6000_loop_align_max_skip
 
 #undef TARGET_OPTION_OVERRIDE
 #define TARGET_OPTION_OVERRIDE rs6000_option_override
 
-#undef TARGET_OPTION_INIT_STRUCT
-#define TARGET_OPTION_INIT_STRUCT rs6000_option_init_struct
-
 #undef TARGET_OPTION_DEFAULT_PARAMS
 #define TARGET_OPTION_DEFAULT_PARAMS rs6000_option_default_params
 
-#undef TARGET_OPTION_OPTIMIZATION_TABLE
-#define TARGET_OPTION_OPTIMIZATION_TABLE rs6000_option_optimization_table
-
 #undef TARGET_VECTORIZE_BUILTIN_VECTORIZED_FUNCTION
 #define TARGET_VECTORIZE_BUILTIN_VECTORIZED_FUNCTION \
   rs6000_builtin_vectorized_function
 
-#undef TARGET_DEFAULT_TARGET_FLAGS
-#define TARGET_DEFAULT_TARGET_FLAGS \
-  (TARGET_DEFAULT)
-
 #ifndef TARGET_MACHO
 #undef TARGET_STACK_PROTECT_FAIL
 #define TARGET_STACK_PROTECT_FAIL rs6000_stack_protect_fail
@@ -3701,21 +3678,6 @@ rs6000_preferred_simd_mode (enum machine_mode mode)
   return word_mode;
 }
 
-/* Implement TARGET_OPTION_INIT_STRUCT.  */
-
-static void
-rs6000_option_init_struct (struct gcc_options *opts)
-{
-  if (DEFAULT_ABI == ABI_DARWIN)
-    /* The Darwin libraries never set errno, so we might as well
-       avoid calling them when that's the only reason we would.  */
-    opts->x_flag_errno_math = 0;
-
-  /* Enable section anchors by default.  */
-  if (!TARGET_MACHO)
-    opts->x_flag_section_anchors = 1;
-}
-
 /* Implement TARGET_OPTION_DEFAULT_PARAMS.  */
 
 static void
@@ -4051,259 +4013,6 @@ rs6000_builtin_vectorized_function (tree fndecl, tree type_out,
 
   return NULL_TREE;
 }
-
-
-/* Implement TARGET_HANDLE_OPTION.  */
-
-static bool
-rs6000_handle_option (struct gcc_options *opts, struct gcc_options *opts_set,
-                     const struct cl_decoded_option *decoded,
-                     location_t loc)
-{
-  enum fpu_type_t fpu_type = FPU_NONE;
-  char *p, *q;
-  size_t code = decoded->opt_index;
-  const char *arg = decoded->arg;
-  int value = decoded->value;
-
-  switch (code)
-    {
-    case OPT_mno_power:
-      opts->x_target_flags &= ~(MASK_POWER | MASK_POWER2
-                               | MASK_MULTIPLE | MASK_STRING);
-      opts_set->x_target_flags |= (MASK_POWER | MASK_POWER2
-                                  | MASK_MULTIPLE | MASK_STRING);
-      break;
-    case OPT_mno_powerpc:
-      opts->x_target_flags &= ~(MASK_POWERPC | MASK_PPC_GPOPT
-                               | MASK_PPC_GFXOPT | MASK_POWERPC64);
-      opts_set->x_target_flags |= (MASK_POWERPC | MASK_PPC_GPOPT
-                                  | MASK_PPC_GFXOPT | MASK_POWERPC64);
-      break;
-    case OPT_mfull_toc:
-      opts->x_target_flags &= ~MASK_MINIMAL_TOC;
-      opts->x_TARGET_NO_FP_IN_TOC = 0;
-      opts->x_TARGET_NO_SUM_IN_TOC = 0;
-      opts_set->x_target_flags |= MASK_MINIMAL_TOC;
-#ifdef TARGET_USES_SYSV4_OPT
-      /* Note, V.4 no longer uses a normal TOC, so make -mfull-toc, be
-        just the same as -mminimal-toc.  */
-      opts->x_target_flags |= MASK_MINIMAL_TOC;
-      opts_set->x_target_flags |= MASK_MINIMAL_TOC;
-#endif
-      break;
-
-#ifdef TARGET_USES_SYSV4_OPT
-    case OPT_mtoc:
-      /* Make -mtoc behave like -mminimal-toc.  */
-      opts->x_target_flags |= MASK_MINIMAL_TOC;
-      opts_set->x_target_flags |= MASK_MINIMAL_TOC;
-      break;
-#endif
-
-#ifdef TARGET_USES_AIX64_OPT
-    case OPT_maix64:
-#else
-    case OPT_m64:
-#endif
-      opts->x_target_flags |= MASK_POWERPC64 | MASK_POWERPC;
-      opts->x_target_flags |= ~opts_set->x_target_flags & MASK_PPC_GFXOPT;
-      opts_set->x_target_flags |= MASK_POWERPC64 | MASK_POWERPC;
-      break;
-
-#ifdef TARGET_USES_AIX64_OPT
-    case OPT_maix32:
-#else
-    case OPT_m32:
-#endif
-      opts->x_target_flags &= ~MASK_POWERPC64;
-      opts_set->x_target_flags |= MASK_POWERPC64;
-      break;
-
-    case OPT_mminimal_toc:
-      if (value == 1)
-       {
-         opts->x_TARGET_NO_FP_IN_TOC = 0;
-         opts->x_TARGET_NO_SUM_IN_TOC = 0;
-       }
-      break;
-
-    case OPT_mpower:
-      if (value == 1)
-       {
-         opts->x_target_flags |= (MASK_MULTIPLE | MASK_STRING);
-         opts_set->x_target_flags |= (MASK_MULTIPLE | MASK_STRING);
-       }
-      break;
-
-    case OPT_mpower2:
-      if (value == 1)
-       {
-         opts->x_target_flags |= (MASK_POWER | MASK_MULTIPLE | MASK_STRING);
-         opts_set->x_target_flags |= (MASK_POWER
-                                      | MASK_MULTIPLE
-                                      | MASK_STRING);
-       }
-      break;
-
-    case OPT_mpowerpc_gpopt:
-    case OPT_mpowerpc_gfxopt:
-      if (value == 1)
-       {
-         opts->x_target_flags |= MASK_POWERPC;
-         opts_set->x_target_flags |= MASK_POWERPC;
-       }
-      break;
-
-    case OPT_mdebug_:
-      p = ASTRDUP (arg);
-      opts->x_rs6000_debug = 0;
-
-      while ((q = strtok (p, ",")) != NULL)
-       {
-         unsigned mask = 0;
-         bool invert;
-
-         p = NULL;
-         if (*q == '!')
-           {
-             invert = true;
-             q++;
-           }
-         else
-           invert = false;
-
-         if (! strcmp (q, "all"))
-           mask = MASK_DEBUG_ALL;
-         else if (! strcmp (q, "stack"))
-           mask = MASK_DEBUG_STACK;
-         else if (! strcmp (q, "arg"))
-           mask = MASK_DEBUG_ARG;
-         else if (! strcmp (q, "reg"))
-           mask = MASK_DEBUG_REG;
-         else if (! strcmp (q, "addr"))
-           mask = MASK_DEBUG_ADDR;
-         else if (! strcmp (q, "cost"))
-           mask = MASK_DEBUG_COST;
-         else if (! strcmp (q, "target"))
-           mask = MASK_DEBUG_TARGET;
-         else
-           error_at (loc, "unknown -mdebug-%s switch", q);
-
-         if (invert)
-           opts->x_rs6000_debug &= ~mask;
-         else  
-           opts->x_rs6000_debug |= mask;
-       }
-      break;
-
-#ifdef TARGET_USES_SYSV4_OPT
-    case OPT_mrelocatable:
-      if (value == 1)
-       {
-         opts->x_target_flags |= MASK_MINIMAL_TOC;
-         opts_set->x_target_flags |= MASK_MINIMAL_TOC;
-         opts->x_TARGET_NO_FP_IN_TOC = 1;
-       }
-      break;
-
-    case OPT_mrelocatable_lib:
-      if (value == 1)
-       {
-         opts->x_target_flags |= MASK_RELOCATABLE | MASK_MINIMAL_TOC;
-         opts_set->x_target_flags |= MASK_RELOCATABLE | MASK_MINIMAL_TOC;
-         opts->x_TARGET_NO_FP_IN_TOC = 1;
-       }
-      else
-       {
-         opts->x_target_flags &= ~MASK_RELOCATABLE;
-         opts_set->x_target_flags |= MASK_RELOCATABLE;
-       }
-      break;
-#endif
-
-    case OPT_mabi_altivec:
-      /* Enabling the AltiVec ABI turns off the SPE ABI.  */
-      opts->x_rs6000_spe_abi = 0;
-      break;
-
-    case OPT_mabi_spe:
-      opts->x_rs6000_altivec_abi = 0;
-      break;
-
-    case OPT_mlong_double_:
-      if (value != 64 && value != 128)
-       {
-         error_at (loc, "unknown switch -mlong-double-%s", arg);
-         opts->x_rs6000_long_double_type_size
-           = RS6000_DEFAULT_LONG_DOUBLE_SIZE;
-         return false;
-       }
-      break;
-
-    case OPT_msingle_float:
-      if (!TARGET_SINGLE_FPU) 
-       warning_at (loc, 0,
-                   "-msingle-float option equivalent to -mhard-float");
-      /* -msingle-float implies -mno-double-float and TARGET_HARD_FLOAT. */
-      opts->x_rs6000_double_float = 0;
-      opts->x_target_flags &= ~MASK_SOFT_FLOAT;
-      opts_set->x_target_flags |= MASK_SOFT_FLOAT;
-      break;
-
-    case OPT_mdouble_float:
-      /* -mdouble-float implies -msingle-float and TARGET_HARD_FLOAT. */
-      opts->x_rs6000_single_float = 1;
-      opts->x_target_flags &= ~MASK_SOFT_FLOAT;
-      opts_set->x_target_flags |= MASK_SOFT_FLOAT;
-      break;
-
-    case OPT_msimple_fpu:
-      if (!TARGET_SINGLE_FPU) 
-       warning_at (loc, 0, "-msimple-fpu option ignored");
-      break;
-
-    case OPT_mhard_float:
-      /* -mhard_float implies -msingle-float and -mdouble-float. */
-      opts->x_rs6000_single_float = opts->x_rs6000_double_float = 1;
-      break;
-
-    case OPT_msoft_float:
-      /* -msoft_float implies -mnosingle-float and -mnodouble-float. */
-      opts->x_rs6000_single_float = opts->x_rs6000_double_float = 0;
-      break;
-
-    case OPT_mfpu_:
-      fpu_type = (enum fpu_type_t) value;
-      if (fpu_type != FPU_NONE)
-       {
-         /* If -mfpu is not none, then turn off SOFT_FLOAT, turn on
-            HARD_FLOAT. */
-         opts->x_target_flags &= ~MASK_SOFT_FLOAT;
-         opts_set->x_target_flags |= MASK_SOFT_FLOAT;
-         opts->x_rs6000_xilinx_fpu = 1;
-         if (fpu_type == FPU_SF_LITE || fpu_type == FPU_SF_FULL) 
-           opts->x_rs6000_single_float = 1;
-         if (fpu_type == FPU_DF_LITE || fpu_type == FPU_DF_FULL) 
-           opts->x_rs6000_single_float = opts->x_rs6000_double_float = 1;
-         if (fpu_type == FPU_SF_LITE || fpu_type == FPU_DF_LITE) 
-           opts->x_rs6000_simple_fpu = 1;
-       }
-      else
-       {
-         /* -mfpu=none is equivalent to -msoft-float.  */
-         opts->x_target_flags |= MASK_SOFT_FLOAT;
-         opts_set->x_target_flags |= MASK_SOFT_FLOAT;
-         opts->x_rs6000_single_float = opts->x_rs6000_double_float = 0;
-       }
-      break;
-
-    case OPT_mrecip:
-      opts->x_rs6000_recip_name = (value) ? "default" : "none";
-      break;
-    }
-  return true;
-}
 \f
 /* Default CPU string for rs6000*_file_start functions.  */
 static const char *rs6000_default_cpu;
index 588572cb008c56ea78e67821810c158436a1627e..5204f589d5d621b1b89a9160768237d7e01f26d8 100644 (file)
@@ -27,7 +27,7 @@ rs6000.o: $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \
   $(OBSTACK_H) $(TREE_H) $(EXPR_H) $(OPTABS_H) except.h function.h \
   output.h $(BASIC_BLOCK_H) $(INTEGRATE_H) toplev.h $(GGC_H) $(HASHTAB_H) \
   $(TM_P_H) $(TARGET_H) $(TARGET_DEF_H) langhooks.h reload.h gt-rs6000.h \
-  cfglayout.h cfgloop.h $(OPTS_H)
+  cfglayout.h cfgloop.h $(OPTS_H) $(COMMON_TARGET_H)
 
 rs6000-c.o: $(srcdir)/config/rs6000/rs6000-c.c \
     $(srcdir)/config/rs6000/rs6000-protos.h \
index 685a261967e7bed48fdb6488b91b30a52f9627b2..296b092d0400954fccf6473879d42d89e9034f2e 100644 (file)
@@ -2283,46 +2283,6 @@ const struct attribute_spec rx_attribute_table[] =
   { NULL,             0, 0, false, false, false, NULL, false }
 };
 
-/* Extra processing for target specific command line options.  */
-
-static bool
-rx_handle_option (struct gcc_options *opts,
-                 struct gcc_options *opts_set ATTRIBUTE_UNUSED,
-                 const struct cl_decoded_option *decoded,
-                 location_t loc)
-{
-  size_t code = decoded->opt_index;
-  int value = decoded->value;
-
-  switch (code)
-    {
-    case OPT_mint_register_:
-      /* Make sure that the -mint-register option is in range.  Other
-        handling in rx_option_override.  */
-      return value >= 0 && value <= 4;
-      break;
-
-    case OPT_mmax_constant_size_:
-      /* Make sure that the -mmax-constant_size option is in range.  */
-      return value >= 0 && value <= 4;
-
-    case OPT_mcpu_:
-      if ((enum rx_cpu_types) value == RX200)
-       opts->x_target_flags |= MASK_NO_USE_FPU;
-      break;
-      
-    case OPT_fpu:
-      if (opts->x_rx_cpu_type == RX200)
-       error_at (loc, "the RX200 cpu does not have FPU hardware");
-      break;
-
-    default:
-      break;
-    }
-
-  return true;
-}
-
 /* Implement TARGET_OVERRIDE_OPTIONS_AFTER_CHANGE.  */
 
 static void
@@ -2405,13 +2365,6 @@ rx_option_override (void)
     align_labels = 3;
 }
 
-/* Implement TARGET_OPTION_OPTIMIZATION_TABLE.  */
-static const struct default_options rx_option_optimization_table[] =
-  {
-    { OPT_LEVELS_1_PLUS, OPT_fomit_frame_pointer, NULL, 1 },
-    { OPT_LEVELS_NONE, 0, NULL, 0 }
-  };
-
 \f
 static bool
 rx_allocate_stack_slots_for_args (void)
@@ -3027,9 +2980,6 @@ rx_adjust_insn_length (rtx insn, int current_length)
 #undef  TARGET_SET_CURRENT_FUNCTION
 #define TARGET_SET_CURRENT_FUNCTION            rx_set_current_function
 
-#undef  TARGET_HANDLE_OPTION
-#define TARGET_HANDLE_OPTION                   rx_handle_option
-
 #undef  TARGET_ASM_INTEGER
 #define TARGET_ASM_INTEGER                     rx_assemble_integer
 
@@ -3069,18 +3019,12 @@ rx_adjust_insn_length (rtx insn, int current_length)
 #undef  TARGET_OPTION_OVERRIDE
 #define TARGET_OPTION_OVERRIDE                 rx_option_override
 
-#undef  TARGET_OPTION_OPTIMIZATION_TABLE
-#define TARGET_OPTION_OPTIMIZATION_TABLE       rx_option_optimization_table
-
 #undef  TARGET_PROMOTE_FUNCTION_MODE
 #define TARGET_PROMOTE_FUNCTION_MODE           rx_promote_function_mode
 
 #undef  TARGET_OVERRIDE_OPTIONS_AFTER_CHANGE
 #define TARGET_OVERRIDE_OPTIONS_AFTER_CHANGE   rx_override_options_after_change
 
-#undef  TARGET_EXCEPT_UNWIND_INFO
-#define TARGET_EXCEPT_UNWIND_INFO              sjlj_except_unwind_info
-
 #undef  TARGET_FLAGS_REGNUM
 #define TARGET_FLAGS_REGNUM                    CC_REG
 
index e86755b37d99531e841ec57ec9cd6332f24b463a..51f10ab3d8a5ab8ddb5df4b0ddf4bf66aded823a 100644 (file)
@@ -55,22 +55,6 @@ along with GCC; see the file COPYING3.  If not see
 #include "cfgloop.h"
 #include "opts.h"
 
-static const int processor_flags_table[] =
-  {
-    /* g5 */     PF_IEEE_FLOAT,
-    /* g6 */     PF_IEEE_FLOAT,
-    /* z900 */   PF_IEEE_FLOAT | PF_ZARCH,
-    /* z990 */   PF_IEEE_FLOAT | PF_ZARCH | PF_LONG_DISPLACEMENT,
-    /* z9-109 */ PF_IEEE_FLOAT | PF_ZARCH | PF_LONG_DISPLACEMENT
-                 | PF_EXTIMM,
-    /* z9-ec */  PF_IEEE_FLOAT | PF_ZARCH | PF_LONG_DISPLACEMENT
-                 | PF_EXTIMM | PF_DFP,
-    /* z10 */    PF_IEEE_FLOAT | PF_ZARCH | PF_LONG_DISPLACEMENT
-                 | PF_EXTIMM | PF_DFP | PF_Z10,
-    /* z196 */   PF_IEEE_FLOAT | PF_ZARCH | PF_LONG_DISPLACEMENT
-                 | PF_EXTIMM | PF_DFP | PF_Z10 | PF_Z196
-  };
-
 /* Define the specific costs for a given cpu.  */
 
 struct processor_costs
@@ -1519,74 +1503,6 @@ s390_init_machine_status (void)
   return ggc_alloc_cleared_machine_function ();
 }
 
-/* Change optimizations to be performed, depending on the
-   optimization level.  */
-
-static const struct default_options s390_option_optimization_table[] =
-  {
-    { OPT_LEVELS_1_PLUS, OPT_fomit_frame_pointer, NULL, 1 },
-
-    /* ??? There are apparently still problems with -fcaller-saves.  */
-    { OPT_LEVELS_ALL, OPT_fcaller_saves, NULL, 0 },
-
-    /* Use MVCLE instructions to decrease code size if requested.  */
-    { OPT_LEVELS_SIZE, OPT_mmvcle, NULL, 1 },
-
-    { OPT_LEVELS_NONE, 0, NULL, 0 }
-  };
-
-/* Implement TARGET_OPTION_INIT_STRUCT.  */
-
-static void
-s390_option_init_struct (struct gcc_options *opts)
-{
-  /* By default, always emit DWARF-2 unwind info.  This allows debugging
-     without maintaining a stack frame back-chain.  */
-  opts->x_flag_asynchronous_unwind_tables = 1;
-}
-
-/* Implement TARGET_HANDLE_OPTION.  */
-
-static bool
-s390_handle_option (struct gcc_options *opts,
-                   struct gcc_options *opts_set ATTRIBUTE_UNUSED,
-                   const struct cl_decoded_option *decoded,
-                   location_t loc)
-{
-  size_t code = decoded->opt_index;
-  const char *arg = decoded->arg;
-  int value = decoded->value;
-
-  switch (code)
-    {
-    case OPT_march_:
-      opts->x_s390_arch_flags = processor_flags_table[value];
-      opts->x_s390_arch_string = arg;
-      return true;
-
-    case OPT_mstack_guard_:
-      if (exact_log2 (value) == -1)
-       error_at (loc, "stack guard value must be an exact power of 2");
-      return true;
-
-    case OPT_mstack_size_:
-      if (exact_log2 (value) == -1)
-       error_at (loc, "stack size must be an exact power of 2");
-      return true;
-
-    case OPT_mtune_:
-      opts->x_s390_tune_flags = processor_flags_table[value];
-      return true;
-
-    case OPT_mwarn_framesize_:
-      return sscanf (arg, HOST_WIDE_INT_PRINT_DEC,
-                    &opts->x_s390_warn_framesize) == 1;
-
-    default:
-      return true;
-    }
-}
-
 static void
 s390_option_override (void)
 {
@@ -10688,21 +10604,9 @@ s390_loop_unroll_adjust (unsigned nunroll, struct loop *loop)
 #undef  TARGET_ASM_CLOSE_PAREN
 #define TARGET_ASM_CLOSE_PAREN ""
 
-#undef TARGET_DEFAULT_TARGET_FLAGS
-#define TARGET_DEFAULT_TARGET_FLAGS (TARGET_DEFAULT)
-
-#undef TARGET_HANDLE_OPTION
-#define TARGET_HANDLE_OPTION s390_handle_option
-
 #undef TARGET_OPTION_OVERRIDE
 #define TARGET_OPTION_OVERRIDE s390_option_override
 
-#undef TARGET_OPTION_OPTIMIZATION_TABLE
-#define TARGET_OPTION_OPTIMIZATION_TABLE s390_option_optimization_table
-
-#undef TARGET_OPTION_INIT_STRUCT
-#define TARGET_OPTION_INIT_STRUCT s390_option_init_struct
-
 #undef TARGET_ENCODE_SECTION_INFO
 #define TARGET_ENCODE_SECTION_INFO s390_encode_section_info
 
index 47e0b1a5662add6429cd66bf67180116d1f2aac4..afd22ad883b30efe1261b175ff0f063f9002f6ba 100644 (file)
@@ -904,4 +904,6 @@ do {                                                                        \
 
 /* Reads can reuse write prefetches, used by tree-ssa-prefetch-loops.c.  */
 #define READ_CAN_USE_WRITE_PREFETCH 1
+
+extern const int processor_flags_table[];
 #endif
index 1c745f061937a96ff5d429c8ca8dc79f900e68ee..c256df295dc3a3ef72d58572b77793913c398a4e 100644 (file)
 
 static void score_option_override (void);
 
-/* Implement TARGET_OPTION_OPTIMIZATION_TABLE.  */
-static const struct default_options score_option_optimization_table[] =
-  {
-    { OPT_LEVELS_1_PLUS, OPT_fomit_frame_pointer, NULL, 1 },
-    { OPT_LEVELS_NONE, 0, NULL, 0 }
-  };
-
 #undef  TARGET_ASM_FILE_START
 #define TARGET_ASM_FILE_START           score_asm_file_start
 
@@ -72,18 +65,9 @@ static const struct default_options score_option_optimization_table[] =
 #undef  TARGET_ASM_FUNCTION_EPILOGUE
 #define TARGET_ASM_FUNCTION_EPILOGUE    score_function_epilogue
 
-#undef TARGET_DEFAULT_TARGET_FLAGS
-#define TARGET_DEFAULT_TARGET_FLAGS     TARGET_DEFAULT
-
-#undef TARGET_HANDLE_OPTION
-#define TARGET_HANDLE_OPTION            score_handle_option
-
 #undef TARGET_OPTION_OVERRIDE
 #define TARGET_OPTION_OVERRIDE          score_option_override
 
-#undef TARGET_OPTION_OPTIMIZATION_TABLE
-#define TARGET_OPTION_OPTIMIZATION_TABLE score_option_optimization_table
-
 #undef TARGET_LEGITIMIZE_ADDRESS
 #define TARGET_LEGITIMIZE_ADDRESS      score_legitimize_address
 
@@ -279,35 +263,6 @@ score_asm_file_end (void)
     gcc_unreachable ();
 }
 
-#define MASK_ALL_CPU_BITS      (MASK_SCORE7 | MASK_SCORE7D)
-
-/* Implement TARGET_HANDLE_OPTION.  */
-static bool
-score_handle_option (struct gcc_options *opts,
-                    struct gcc_options *opts_set ATTRIBUTE_UNUSED,
-                    const struct cl_decoded_option *decoded,
-                    location_t loc ATTRIBUTE_UNUSED)
-{
-  size_t code = decoded->opt_index;
-  int value = decoded->value;
-
-  switch (code)
-    {
-    case OPT_mscore7d:
-      opts->x_target_flags &= ~(MASK_ALL_CPU_BITS);
-      opts->x_target_flags |= MASK_SCORE7 | MASK_SCORE7D;
-      return true;
-
-    case OPT_march_:
-      opts->x_target_flags &= ~(MASK_ALL_CPU_BITS);
-      opts->x_target_flags |= value;
-      return true;
-
-    default:
-      return true;
-    }
-}
-
 /* Implement TARGET_OPTION_OVERRIDE hook.  */
 static void
 score_option_override (void)
index f81172545a4dd4c0cda911d6b4c70522c8c1a66d..c677a630db4317c8cac23d1f9e095464b0e45149 100644 (file)
@@ -168,8 +168,6 @@ int assembler_dialect;
 
 static bool shmedia_space_reserved_for_target_registers;
 
-static bool sh_handle_option (struct gcc_options *, struct gcc_options *,
-                             const struct cl_decoded_option *, location_t);
 static void split_branches (rtx);
 static int branch_dest (rtx);
 static void force_into (rtx, rtx);
@@ -184,7 +182,6 @@ 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_init_struct (struct gcc_options *);
 static void sh_option_default_params (void);
 static void output_stack_adjust (int, rtx, int, HARD_REG_SET *, bool);
 static rtx frame_insn (rtx);
@@ -329,23 +326,6 @@ static const struct attribute_spec sh_attribute_table[] =
     sh2a_handle_function_vector_handler_attribute, false },
   { NULL,                0, 0, false, false, false, NULL, false }
 };
-
-/* Set default optimization options.  */
-static const struct default_options sh_option_optimization_table[] =
-  {
-    { OPT_LEVELS_1_PLUS, OPT_fomit_frame_pointer, NULL, 1 },
-    { OPT_LEVELS_1_PLUS_SPEED_ONLY, OPT_mdiv_, "inv:minlat", 1 },
-    { OPT_LEVELS_SIZE, OPT_mdiv_, SH_DIV_STR_FOR_SIZE, 1 },
-    { OPT_LEVELS_0_ONLY, OPT_mdiv_, "", 1 },
-    { OPT_LEVELS_SIZE, OPT_mcbranchdi, NULL, 0 },
-    /* We can't meaningfully test TARGET_SHMEDIA here, because -m
-       options haven't been parsed yet, hence we'd read only the
-       default.  sh_target_reg_class will return NO_REGS if this is
-       not SHMEDIA, so it's OK to always set
-       flag_branch_target_load_optimize.  */
-    { OPT_LEVELS_2_PLUS, OPT_fbranch_target_load_optimize, NULL, 1 },
-    { OPT_LEVELS_NONE, 0, NULL, 0 }
-  };
 \f
 /* Initialize the GCC target structure.  */
 #undef TARGET_ATTRIBUTE_TABLE
@@ -365,10 +345,6 @@ static const struct default_options sh_option_optimization_table[] =
 
 #undef TARGET_OPTION_OVERRIDE
 #define TARGET_OPTION_OVERRIDE sh_option_override
-#undef TARGET_OPTION_OPTIMIZATION_TABLE
-#define TARGET_OPTION_OPTIMIZATION_TABLE sh_option_optimization_table
-#undef TARGET_OPTION_INIT_STRUCT
-#define TARGET_OPTION_INIT_STRUCT sh_option_init_struct
 #undef TARGET_OPTION_DEFAULT_PARAMS
 #define TARGET_OPTION_DEFAULT_PARAMS sh_option_default_params
 
@@ -395,11 +371,6 @@ static const struct default_options sh_option_optimization_table[] =
 #undef TARGET_ASM_FILE_START_FILE_DIRECTIVE
 #define TARGET_ASM_FILE_START_FILE_DIRECTIVE true
 
-#undef TARGET_DEFAULT_TARGET_FLAGS
-#define TARGET_DEFAULT_TARGET_FLAGS TARGET_DEFAULT
-#undef TARGET_HANDLE_OPTION
-#define TARGET_HANDLE_OPTION sh_handle_option
-
 #undef TARGET_REGISTER_MOVE_COST
 #define TARGET_REGISTER_MOVE_COST sh_register_move_cost
 
@@ -607,157 +578,7 @@ static const struct default_options sh_option_optimization_table[] =
 
 struct gcc_target targetm = TARGET_INITIALIZER;
 \f
-/* Implement TARGET_HANDLE_OPTION.  */
-
-static bool
-sh_handle_option (struct gcc_options *opts,
-                 struct gcc_options *opts_set ATTRIBUTE_UNUSED,
-                 const struct cl_decoded_option *decoded,
-                 location_t loc ATTRIBUTE_UNUSED)
-{
-  size_t code = decoded->opt_index;
-
-  switch (code)
-    {
-    case OPT_m1:
-      opts->x_target_flags = (opts->x_target_flags & ~MASK_ARCH) | SELECT_SH1;
-      return true;
-
-    case OPT_m2:
-      opts->x_target_flags = (opts->x_target_flags & ~MASK_ARCH) | SELECT_SH2;
-      return true;
-
-    case OPT_m2a:
-      opts->x_target_flags = (opts->x_target_flags & ~MASK_ARCH) | SELECT_SH2A;
-      return true;
-
-    case OPT_m2a_nofpu:
-      opts->x_target_flags
-       = (opts->x_target_flags & ~MASK_ARCH) | SELECT_SH2A_NOFPU;
-      return true;
-
-    case OPT_m2a_single:
-      opts->x_target_flags
-       = (opts->x_target_flags & ~MASK_ARCH) | SELECT_SH2A_SINGLE;
-      return true;
-
-    case OPT_m2a_single_only:
-      opts->x_target_flags
-       = (opts->x_target_flags & ~MASK_ARCH) | SELECT_SH2A_SINGLE_ONLY;
-      return true;
-
-    case OPT_m2e:
-      opts->x_target_flags = (opts->x_target_flags & ~MASK_ARCH) | SELECT_SH2E;
-      return true;
-
-    case OPT_m3:
-      opts->x_target_flags = (opts->x_target_flags & ~MASK_ARCH) | SELECT_SH3;
-      return true;
-
-    case OPT_m3e:
-      opts->x_target_flags = (opts->x_target_flags & ~MASK_ARCH) | SELECT_SH3E;
-      return true;
-
-    case OPT_m4:
-    case OPT_m4_100:
-    case OPT_m4_200:
-    case OPT_m4_300:
-      opts->x_target_flags = (opts->x_target_flags & ~MASK_ARCH) | SELECT_SH4;
-      return true;
-
-    case OPT_m4_nofpu:
-    case OPT_m4_100_nofpu:
-    case OPT_m4_200_nofpu:
-    case OPT_m4_300_nofpu:
-    case OPT_m4_340:
-    case OPT_m4_400:
-    case OPT_m4_500:
-      opts->x_target_flags
-       = (opts->x_target_flags & ~MASK_ARCH) | SELECT_SH4_NOFPU;
-      return true;
-
-    case OPT_m4_single:
-    case OPT_m4_100_single:
-    case OPT_m4_200_single:
-    case OPT_m4_300_single:
-      opts->x_target_flags
-       = (opts->x_target_flags & ~MASK_ARCH) | SELECT_SH4_SINGLE;
-      return true;
-
-    case OPT_m4_single_only:
-    case OPT_m4_100_single_only:
-    case OPT_m4_200_single_only:
-    case OPT_m4_300_single_only:
-      opts->x_target_flags
-       = (opts->x_target_flags & ~MASK_ARCH) | SELECT_SH4_SINGLE_ONLY;
-      return true;
-
-    case OPT_m4a:
-      opts->x_target_flags = (opts->x_target_flags & ~MASK_ARCH) | SELECT_SH4A;
-      return true;
-
-    case OPT_m4a_nofpu:
-    case OPT_m4al:
-      opts->x_target_flags
-       = (opts->x_target_flags & ~MASK_ARCH) | SELECT_SH4A_NOFPU;
-      return true;
-
-    case OPT_m4a_single:
-      opts->x_target_flags
-       = (opts->x_target_flags & ~MASK_ARCH) | SELECT_SH4A_SINGLE;
-      return true;
-
-    case OPT_m4a_single_only:
-      opts->x_target_flags
-       = (opts->x_target_flags & ~MASK_ARCH) | SELECT_SH4A_SINGLE_ONLY;
-      return true;
-
-    case OPT_m5_32media:
-      opts->x_target_flags
-       = (opts->x_target_flags & ~MASK_ARCH) | SELECT_SH5_32MEDIA;
-      return true;
-
-    case OPT_m5_32media_nofpu:
-      opts->x_target_flags
-       = (opts->x_target_flags & ~MASK_ARCH) | SELECT_SH5_32MEDIA_NOFPU;
-      return true;
-
-    case OPT_m5_64media:
-      opts->x_target_flags
-       = (opts->x_target_flags & ~MASK_ARCH) | SELECT_SH5_64MEDIA;
-      return true;
-
-    case OPT_m5_64media_nofpu:
-      opts->x_target_flags
-       = (opts->x_target_flags & ~MASK_ARCH) | SELECT_SH5_64MEDIA_NOFPU;
-      return true;
-
-    case OPT_m5_compact:
-      opts->x_target_flags
-       = (opts->x_target_flags & ~MASK_ARCH) | SELECT_SH5_COMPACT;
-      return true;
-
-    case OPT_m5_compact_nofpu:
-      opts->x_target_flags
-       = (opts->x_target_flags & ~MASK_ARCH) | SELECT_SH5_COMPACT_NOFPU;
-      return true;
-
-    default:
-      return true;
-    }
-}
 \f
-/* Implement TARGET_OPTION_INIT_STRUCT.  */
-static void
-sh_option_init_struct (struct gcc_options *opts)
-{
-  /* We can't meaningfully test TARGET_SH2E / TARGET_IEEE
-     here, so leave it to TARGET_OPTION_OVERRIDE to set
-     flag_finite_math_only.  We set it to 2 here so we know if the user
-     explicitly requested this to be on or off.  */
-  opts->x_flag_finite_math_only = 2;
-}
-
 /* Implement TARGET_OPTION_DEFAULT_PARAMS.  */
 static void
 sh_option_default_params (void)
index 0de98c67974143ab516f2fe6519c19c5fc0a85d0..0bad6fe79785c40d5d9bb9d837f7ae2b85c1a654 100644 (file)
@@ -48,6 +48,7 @@ along with GCC; see the file COPYING3.  If not see
 #include "debug.h"
 #include "target.h"
 #include "target-def.h"
+#include "common/common-target.h"
 #include "cfglayout.h"
 #include "gimple.h"
 #include "langhooks.h"
@@ -494,13 +495,6 @@ enum cmodel sparc_cmodel;
 
 char sparc_hard_reg_printed[8];
 
-/* Implement TARGET_OPTION_OPTIMIZATION_TABLE.  */
-static const struct default_options sparc_option_optimization_table[] =
-  {
-    { OPT_LEVELS_1_PLUS, OPT_fomit_frame_pointer, NULL, 1 },
-    { OPT_LEVELS_NONE, 0, NULL, 0 }
-  };
-
 /* Initialize the GCC target structure.  */
 
 /* The default is to use .half rather than .short for aligned HI objects.  */
@@ -633,12 +627,8 @@ static const struct default_options sparc_option_optimization_table[] =
 #undef TARGET_RELAXED_ORDERING
 #define TARGET_RELAXED_ORDERING SPARC_RELAXED_ORDERING
 
-#undef TARGET_DEFAULT_TARGET_FLAGS
-#define TARGET_DEFAULT_TARGET_FLAGS TARGET_DEFAULT
 #undef TARGET_OPTION_OVERRIDE
 #define TARGET_OPTION_OVERRIDE sparc_option_override
-#undef TARGET_OPTION_OPTIMIZATION_TABLE
-#define TARGET_OPTION_OPTIMIZATION_TABLE sparc_option_optimization_table
 
 #if TARGET_GNU_TLS && defined(HAVE_AS_SPARC_UA_PCREL)
 #undef TARGET_ASM_OUTPUT_DWARF_DTPREL
index 9e62f16414cd49ece05edcc7fa42ca1fdd61a2e7..38db96934f317a11f8bece1b4b8b4360c4adaebd 100644 (file)
@@ -149,7 +149,6 @@ char regs_ever_allocated[FIRST_PSEUDO_REGISTER];
 
 /*  Prototypes and external defs.  */
 static void spu_option_override (void);
-static void spu_option_init_struct (struct gcc_options *opts);
 static void spu_option_default_params (void);
 static void spu_init_builtins (void);
 static tree spu_builtin_decl (unsigned, bool);
@@ -422,9 +421,6 @@ static const struct attribute_spec spu_attribute_table[] =
 #undef TARGET_GIMPLIFY_VA_ARG_EXPR
 #define TARGET_GIMPLIFY_VA_ARG_EXPR spu_gimplify_va_arg_expr
 
-#undef TARGET_DEFAULT_TARGET_FLAGS
-#define TARGET_DEFAULT_TARGET_FLAGS (TARGET_DEFAULT)
-
 #undef TARGET_INIT_LIBFUNCS
 #define TARGET_INIT_LIBFUNCS spu_init_libfuncs
 
@@ -485,15 +481,9 @@ static const struct attribute_spec spu_attribute_table[] =
 #undef TARGET_OPTION_OVERRIDE
 #define TARGET_OPTION_OVERRIDE spu_option_override
 
-#undef TARGET_OPTION_INIT_STRUCT
-#define TARGET_OPTION_INIT_STRUCT spu_option_init_struct
-
 #undef TARGET_OPTION_DEFAULT_PARAMS
 #define TARGET_OPTION_DEFAULT_PARAMS spu_option_default_params
 
-#undef TARGET_EXCEPT_UNWIND_INFO
-#define TARGET_EXCEPT_UNWIND_INFO  sjlj_except_unwind_info
-
 #undef TARGET_CONDITIONAL_REGISTER_USAGE
 #define TARGET_CONDITIONAL_REGISTER_USAGE spu_conditional_register_usage
 
@@ -512,13 +502,6 @@ static const struct attribute_spec spu_attribute_table[] =
 
 struct gcc_target targetm = TARGET_INITIALIZER;
 
-static void
-spu_option_init_struct (struct gcc_options *opts)
-{
-  /* With so many registers this is better on by default. */
-  opts->x_flag_rename_registers = 1;
-}
-
 /* Implement TARGET_OPTION_DEFAULT_PARAMS.  */
 static void
 spu_option_default_params (void)
index 6edc2c1873bd2ee9f305599a5566c03b40979c9c..b0e33c3e3883ab9ffd2eed01081d8039274a567a 100644 (file)
@@ -2602,13 +2602,6 @@ xstormy16_return_in_memory (const_tree type, const_tree fntype ATTRIBUTE_UNUSED)
   return (size == -1 || size > UNITS_PER_WORD * NUM_ARGUMENT_REGISTERS);
 }
 \f
-/* Implement TARGET_OPTION_OPTIMIZATION_TABLE.  */
-static const struct default_options xstorym16_option_optimization_table[] =
-  {
-    { OPT_LEVELS_1_PLUS, OPT_fomit_frame_pointer, NULL, 1 },
-    { OPT_LEVELS_NONE, 0, NULL, 0 }
-  };
-\f
 #undef  TARGET_ASM_ALIGNED_HI_OP
 #define TARGET_ASM_ALIGNED_HI_OP "\t.hword\t"
 #undef  TARGET_ASM_ALIGNED_SI_OP
@@ -2682,9 +2675,6 @@ static const struct default_options xstorym16_option_optimization_table[] =
 #undef TARGET_TRAMPOLINE_INIT
 #define TARGET_TRAMPOLINE_INIT xstormy16_trampoline_init
 
-#undef TARGET_OPTION_OPTIMIZATION_TABLE
-#define TARGET_OPTION_OPTIMIZATION_TABLE xstorym16_option_optimization_table
-
 struct gcc_target targetm = TARGET_INITIALIZER;
 
 #include "gt-stormy16.h"
index 18e8a4e0374d90301116b277fd0a9884fd0160c3..92812ceade3a184ea1b5f591509996124cef3180 100644 (file)
 
 static void v850_print_operand_address (FILE *, rtx);
 
-/* Information about the various small memory areas.  */
-static const int small_memory_physical_max[(int) SMALL_MEMORY_max] =
-{
-  256,
-  65536,
-  32768,
-};
-
 /* Names of the various data areas used on the v850.  */
 tree GHS_default_section_names [(int) COUNT_OF_GHS_SECTION_KINDS];
 tree GHS_current_section_names [(int) COUNT_OF_GHS_SECTION_KINDS];
@@ -81,93 +73,6 @@ static GTY(()) section * tdata_section;
 static GTY(()) section * zdata_section;
 static GTY(()) section * zbss_section;
 \f
-/* Set the maximum size of small memory area TYPE to the value given
-   by SIZE in structure OPTS (option text OPT passed at location LOC).  */
-
-static void
-v850_handle_memory_option (enum small_memory_type type,
-                          struct gcc_options *opts, const char *opt,
-                          int size, location_t loc)
-{
-  if (size > small_memory_physical_max[type])
-    error_at (loc, "value passed in %qs is too large", opt);
-  else
-    opts->x_small_memory_max[type] = size;
-}
-
-/* Implement TARGET_HANDLE_OPTION.  */
-
-static bool
-v850_handle_option (struct gcc_options *opts,
-                   struct gcc_options *opts_set ATTRIBUTE_UNUSED,
-                   const struct cl_decoded_option *decoded,
-                   location_t loc)
-{
-  size_t code = decoded->opt_index;
-  int value = decoded->value;
-
-  switch (code)
-    {
-    case OPT_mspace:
-      opts->x_target_flags |= MASK_EP | MASK_PROLOG_FUNCTION;
-      return true;
-
-    case OPT_mv850:
-      opts->x_target_flags &= ~(MASK_CPU ^ MASK_V850);
-      return true;
-
-    case OPT_mv850e:
-    case OPT_mv850e1:
-    case OPT_mv850es:
-      opts->x_target_flags &= ~(MASK_CPU ^ MASK_V850E);
-      return true;
-
-    case OPT_mv850e2:
-      opts->x_target_flags &= ~(MASK_CPU ^ MASK_V850E2);
-      return true;
-
-    case OPT_mv850e2v3:
-      opts->x_target_flags &= ~(MASK_CPU ^ MASK_V850E2V3);
-      return true;
-
-    case OPT_mtda_:
-      v850_handle_memory_option (SMALL_MEMORY_TDA, opts,
-                                decoded->orig_option_with_args_text,
-                                value, loc);
-      return true;
-
-    case OPT_msda_:
-      v850_handle_memory_option (SMALL_MEMORY_SDA, opts,
-                                decoded->orig_option_with_args_text,
-                                value, loc);
-      return true;
-
-    case OPT_mzda_:
-      v850_handle_memory_option (SMALL_MEMORY_ZDA, opts,
-                                decoded->orig_option_with_args_text,
-                                value, loc);
-      return true;
-
-    default:
-      return true;
-    }
-}
-
-/* Implement TARGET_OPTION_OPTIMIZATION_TABLE.  */
-
-static const struct default_options v850_option_optimization_table[] =
-  {
-    { OPT_LEVELS_1_PLUS, OPT_fomit_frame_pointer, NULL, 1 },
-    /* 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.  */
-    { OPT_LEVELS_1_PLUS, OPT_mprolog_function, NULL, 1 },
-    { OPT_LEVELS_NONE, 0, NULL, 0 }
-  };
-
 /* Handle the TARGET_PASS_BY_REFERENCE target hook.
    Specify whether to pass the argument by reference.  */
 
@@ -3216,11 +3121,6 @@ static const struct attribute_spec v850_attribute_table[] =
 #undef  TARGET_ASM_FILE_START_FILE_DIRECTIVE
 #define TARGET_ASM_FILE_START_FILE_DIRECTIVE true
 
-#undef  TARGET_DEFAULT_TARGET_FLAGS
-#define TARGET_DEFAULT_TARGET_FLAGS (MASK_DEFAULT | MASK_APP_REGS)
-#undef  TARGET_HANDLE_OPTION
-#define TARGET_HANDLE_OPTION v850_handle_option
-
 #undef  TARGET_RTX_COSTS
 #define TARGET_RTX_COSTS v850_rtx_costs
 
@@ -3276,9 +3176,6 @@ 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_TABLE
-#define TARGET_OPTION_OPTIMIZATION_TABLE v850_option_optimization_table
-
 #undef  TARGET_LEGITIMATE_CONSTANT_P
 #define TARGET_LEGITIMATE_CONSTANT_P v850_legitimate_constant_p
 
index cc8c3f67e94ad9d48844bae1966fe6ed8f0db781..b80e9f63619b95dea366aeaeb09b6f5a1255b1b4 100644 (file)
@@ -1,6 +1,6 @@
 /* Subroutines for insn-output.c for VAX.
    Copyright (C) 1987, 1994, 1995, 1997, 1998, 1999, 2000, 2001, 2002,
-   2004, 2005, 2006, 2007, 2008, 2009, 2010
+   2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011
    Free Software Foundation, Inc.
 
 This file is part of GCC.
@@ -86,9 +86,6 @@ static int vax_return_pops_args (tree, tree, int);
 #undef TARGET_ASM_CAN_OUTPUT_MI_THUNK
 #define TARGET_ASM_CAN_OUTPUT_MI_THUNK default_can_output_mi_thunk_no_vcall
 
-#undef TARGET_DEFAULT_TARGET_FLAGS
-#define TARGET_DEFAULT_TARGET_FLAGS TARGET_DEFAULT
-
 #undef TARGET_RTX_COSTS
 #define TARGET_RTX_COSTS vax_rtx_costs
 #undef TARGET_ADDRESS_COST
index fe5798ec9ae6f91ce571468dedc8bf5e56b6ea96..d2cadd2b1c3c4ab4625985f1912754bd47fbabf6 100644 (file)
@@ -177,20 +177,6 @@ static bool xtensa_legitimate_constant_p (enum machine_mode, rtx);
 
 static const int reg_nonleaf_alloc_order[FIRST_PSEUDO_REGISTER] =
   REG_ALLOC_ORDER;
-
-/* Implement TARGET_OPTION_OPTIMIZATION_TABLE.  */
-
-static const struct default_options xtensa_option_optimization_table[] =
-  {
-    { OPT_LEVELS_1_PLUS, OPT_fomit_frame_pointer, NULL, 1 },
-    /* 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.  */
-    { OPT_LEVELS_ALL, OPT_freorder_blocks, NULL, 0 },
-    { OPT_LEVELS_NONE, 0, NULL, 0 }
-  };
 \f
 
 /* This macro generates the assembly code for function exit,
@@ -210,9 +196,6 @@ static const struct default_options xtensa_option_optimization_table[] =
 #undef TARGET_ASM_SELECT_RTX_SECTION
 #define TARGET_ASM_SELECT_RTX_SECTION  xtensa_select_rtx_section
 
-#undef TARGET_DEFAULT_TARGET_FLAGS
-#define TARGET_DEFAULT_TARGET_FLAGS (TARGET_DEFAULT)
-
 #undef TARGET_LEGITIMIZE_ADDRESS
 #define TARGET_LEGITIMIZE_ADDRESS xtensa_legitimize_address
 #undef TARGET_MODE_DEPENDENT_ADDRESS_P
@@ -304,8 +287,6 @@ static const struct default_options xtensa_option_optimization_table[] =
 
 #undef TARGET_OPTION_OVERRIDE
 #define TARGET_OPTION_OVERRIDE xtensa_option_override
-#undef TARGET_OPTION_OPTIMIZATION_TABLE
-#define TARGET_OPTION_OPTIMIZATION_TABLE xtensa_option_optimization_table
 
 #undef TARGET_ASM_OUTPUT_ADDR_CONST_EXTRA
 #define TARGET_ASM_OUTPUT_ADDR_CONST_EXTRA xtensa_output_addr_const_extra
index 1b47938b1702e924c8164d560e9a1d5d67837bbc..55a2d5d49285c6f4996604fe67df299c0fc1b334 100644 (file)
@@ -1,3 +1,9 @@
+2011-06-14  Joseph Myers  <joseph@codesourcery.com>
+
+       * Make-lang.in (cp/method.o): Update dependencies.
+       * method.c: Include common/common-target.h.
+       (use_thunk): Use targetm_common.have_named_sections.
+
 2011-06-14  Steve Ellcey  <sje@cup.hp.com>
 
        * decl.c (cxx_init_decl_processing): Use ptr_mode instead of Pmode.
index 45efd67d8cdb15ac55d083163eb34d89f40b4f7e..c47132280bf420989bfc6a90fefcb81b780b1369 100644 (file)
@@ -292,7 +292,8 @@ cp/friend.o: cp/friend.c $(CXX_TREE_H) $(TM_H) $(FLAGS_H)
 cp/init.o: cp/init.c $(CXX_TREE_H) $(TM_H) $(FLAGS_H) \
   $(EXCEPT_H) $(TARGET_H)
 cp/method.o: cp/method.c $(CXX_TREE_H) $(TM_H) toplev.h \
-  $(TM_P_H) $(TARGET_H) $(DIAGNOSTIC_H) gt-cp-method.h $(GIMPLE_H)
+  $(TM_P_H) $(TARGET_H) $(DIAGNOSTIC_H) gt-cp-method.h $(GIMPLE_H) \
+  $(COMMON_TARGET_H)
 cp/cvt.o: cp/cvt.c $(CXX_TREE_H) $(TM_H) cp/decl.h $(FLAGS_H) \
   convert.h $(TARGET_H) intl.h
 cp/search.o: cp/search.c $(CXX_TREE_H) $(TM_H) $(FLAGS_H) toplev.h \
index 918870056db9d6df9724680f26f96de218118601..06e20e271752973a119299201ab23126d7b017d4 100644 (file)
@@ -34,6 +34,7 @@ along with GCC; see the file COPYING3.  If not see
 #include "toplev.h"
 #include "tm_p.h"
 #include "target.h"
+#include "common/common-target.h"
 #include "tree-pass.h"
 #include "diagnostic.h"
 #include "cgraph.h"
@@ -353,7 +354,7 @@ use_thunk (tree thunk_fndecl, bool emit_p)
   push_to_top_level ();
 
   if (TARGET_USE_LOCAL_THUNK_ALIAS_P (function)
-      && targetm.have_named_sections)
+      && targetm_common.have_named_sections)
     {
       resolve_unique_section (function, 0, flag_function_sections);
 
index 9160fb3ded91f98f9b94b6dd779b1184b568e5e3..8c59b4594383bdf0751ac843128d936d40261864 100644 (file)
@@ -88,6 +88,7 @@ along with GCC; see the file COPYING3.  If not see
 #include "debug.h"
 #include "function.h"
 #include "target.h"
+#include "common/common-target.h"
 #include "langhooks.h"
 #include "obstack.h"
 #include "expr.h"
@@ -951,7 +952,7 @@ dbxout_function_end (tree decl ATTRIBUTE_UNUSED)
      named sections.  */
   if (!use_gnu_debug_info_extensions
       || NO_DBX_FUNCTION_END
-      || !targetm.have_named_sections)
+      || !targetm_common.have_named_sections)
     return;
 
   /* By convention, GCC will mark the end of a function with an N_FUN
index 815ddd243f8ca0dc9e96e01f871c69adbe1e49ad..5e84cb8cd78fd02649ae7155ef1d2533835b0e84 100644 (file)
@@ -1,6 +1,6 @@
 /* Definitions of various defaults for tm.h macros.
    Copyright (C) 1992, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
-   2005, 2007, 2008, 2009, 2010
+   2005, 2007, 2008, 2009, 2010, 2011
    Free Software Foundation, Inc.
    Contributed by Ron Guilmette (rfg@monkeys.com)
 
@@ -1288,9 +1288,9 @@ see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
 #ifdef STACK_CHECK_PROTECT
 #define STACK_OLD_CHECK_PROTECT STACK_CHECK_PROTECT
 #else
-#define STACK_OLD_CHECK_PROTECT                                        \
- (targetm.except_unwind_info (&global_options) == UI_SJLJ      \
-  ? 75 * UNITS_PER_WORD                                                \
+#define STACK_OLD_CHECK_PROTECT                                                \
+ (targetm_common.except_unwind_info (&global_options) == UI_SJLJ       \
+  ? 75 * UNITS_PER_WORD                                                        \
   : 8 * 1024)
 #endif
 
@@ -1298,9 +1298,9 @@ see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
    overflow detection.  The default value conveys an estimate of the amount
    of stack required to propagate an exception.  */
 #ifndef STACK_CHECK_PROTECT
-#define STACK_CHECK_PROTECT                                    \
- (targetm.except_unwind_info (&global_options) == UI_SJLJ      \
-  ? 75 * UNITS_PER_WORD                                                \
+#define STACK_CHECK_PROTECT                                            \
+ (targetm_common.except_unwind_info (&global_options) == UI_SJLJ       \
+  ? 75 * UNITS_PER_WORD                                                        \
   : 12 * 1024)
 #endif
 
index cda7f306a9eecbf76e10ecdff5778292a983e465..d1752fd83f4bf8fc1cc61a21097dfb076e6973c5 100644 (file)
@@ -678,7 +678,7 @@ This variable is declared in @file{options.h}, which is included before
 any target-specific headers.
 @end deftypevar
 
-@deftypevr {Target Hook} int TARGET_DEFAULT_TARGET_FLAGS
+@deftypevr {Common Target Hook} int TARGET_DEFAULT_TARGET_FLAGS
 This variable specifies the initial value of @code{target_flags}.
 Its default setting is 0.
 @end deftypevr
@@ -686,7 +686,7 @@ Its default setting is 0.
 @cindex optional hardware or system features
 @cindex features, optional, in system conventions
 
-@deftypefn {Target Hook} bool TARGET_HANDLE_OPTION (struct gcc_options *@var{opts}, struct gcc_options *@var{opts_set}, const struct cl_decoded_option *@var{decoded}, unsigned int @var{loc})
+@deftypefn {Common Target Hook} bool TARGET_HANDLE_OPTION (struct gcc_options *@var{opts}, struct gcc_options *@var{opts_set}, const struct cl_decoded_option *@var{decoded}, location_t @var{loc})
 This hook is called whenever the user specifies one of the
 target-specific options described by the @file{.opt} definition files
 (@pxref{Options}).  It has the opportunity to do some option-specific
@@ -744,7 +744,7 @@ used to alter option flag variables which only exist in those
 frontends.
 @end defmac
 
-@deftypevr {Target Hook} {const struct default_options *} TARGET_OPTION_OPTIMIZATION_TABLE
+@deftypevr {Common Target Hook} {const struct default_options *} TARGET_OPTION_OPTIMIZATION_TABLE
 Some machines may desire to change what optimizations are performed for
 various optimization levels.   This variable, if defined, describes
 options to enable at particular sets of optimization levels.  These
@@ -758,7 +758,7 @@ options are changed via @code{#pragma GCC optimize} or by using the
 @code{optimize} attribute.
 @end deftypevr
 
-@deftypefn {Target Hook} void TARGET_OPTION_INIT_STRUCT (struct gcc_options *@var{opts})
+@deftypefn {Common Target Hook} void TARGET_OPTION_INIT_STRUCT (struct gcc_options *@var{opts})
 Set target-dependent initial values of fields in @var{opts}.
 @end deftypefn
 
@@ -4965,7 +4965,7 @@ The default version of this hook invokes a function called
 normally defined in @file{libgcc2.c}.
 @end deftypefn
 
-@deftypefn {Target Hook} bool TARGET_SUPPORTS_SPLIT_STACK (bool @var{report}, struct gcc_options *@var{opts})
+@deftypefn {Common Target Hook} bool TARGET_SUPPORTS_SPLIT_STACK (bool @var{report}, struct gcc_options *@var{opts})
 Whether this target supports splitting the stack when the options described in @var{opts} have been passed.  This is called after options have been parsed, so the target may reject splitting the stack in some configurations.  The default version of this hook returns false.  If @var{report} is true, this function may issue a warning or error; if @var{report} is false, it must simply return a value
 @end deftypefn
 
@@ -7355,7 +7355,7 @@ Return NULL if function should go to default text section.
 Used by the target to emit any assembler directives or additional  labels needed when a function is partitioned between different  sections.  Output should be written to @var{file}.  The function  decl is available as @var{decl} and the new section is `cold' if  @var{new_is_cold} is @code{true}.
 @end deftypefn
 
-@deftypevr {Target Hook} bool TARGET_HAVE_NAMED_SECTIONS
+@deftypevr {Common Target Hook} bool TARGET_HAVE_NAMED_SECTIONS
 This flag is true if the target supports @code{TARGET_ASM_NAMED_SECTION}.
 It must not be modified by command-line option processing.
 @end deftypevr
@@ -8870,7 +8870,7 @@ Otherwise, if your target supports this information (if it defines
 or @code{OBJECT_FORMAT_ELF}), GCC will provide a default definition of 1.
 @end defmac
 
-@deftypefn {Target Hook} {enum unwind_info_type} TARGET_EXCEPT_UNWIND_INFO (struct gcc_options *@var{opts})
+@deftypefn {Common Target Hook} {enum unwind_info_type} TARGET_EXCEPT_UNWIND_INFO (struct gcc_options *@var{opts})
 This hook defines the mechanism that will be used for exception handling
 by the target.  If the target has ABI specified unwind tables, the hook
 should return @code{UI_TARGET}.  If the target is to use the
@@ -8896,7 +8896,7 @@ The default implementation of the hook first honors the
 must define this hook so that @var{opts} is used correctly.
 @end deftypefn
 
-@deftypevr {Target Hook} bool TARGET_UNWIND_TABLES_DEFAULT
+@deftypevr {Common Target Hook} bool TARGET_UNWIND_TABLES_DEFAULT
 This variable should be set to @code{true} if the target ABI requires unwinding
 tables even when exceptions are not used.  It must not be modified by
 command-line option processing.
index c1c22b46323f7be7d2df06f18172249a5c4af2b2..9ea8a299b1b3ee3744a01c83eb7e43c22d99d8d2 100644 (file)
@@ -85,6 +85,7 @@ along with GCC; see the file COPYING3.  If not see
 #include "tree-pretty-print.h"
 #include "debug.h"
 #include "target.h"
+#include "common/common-target.h"
 #include "langhooks.h"
 #include "hashtab.h"
 #include "cgraph.h"
@@ -154,7 +155,7 @@ dwarf2out_do_frame (void)
     return true;
 
   if ((flag_unwind_tables || flag_exceptions)
-      && targetm.except_unwind_info (&global_options) == UI_DWARF2)
+      && targetm_common.except_unwind_info (&global_options) == UI_DWARF2)
     return true;
 
   return false;
@@ -190,7 +191,7 @@ dwarf2out_do_cfi_asm (void)
      dwarf2 unwind info for exceptions, then emit .debug_frame by hand.  */
   if (!HAVE_GAS_CFI_SECTIONS_DIRECTIVE
       && !flag_unwind_tables && !flag_exceptions
-      && targetm.except_unwind_info (&global_options) != UI_DWARF2)
+      && targetm_common.except_unwind_info (&global_options) != UI_DWARF2)
     return false;
 
   saved_do_cfi_asm = true;
@@ -4081,7 +4082,7 @@ dwarf2out_begin_prologue (unsigned int line ATTRIBUTE_UNUSED,
      call-site information.  We must emit this label if it might be used.  */
   if (!do_frame
       && (!flag_exceptions
-         || targetm.except_unwind_info (&global_options) != UI_TARGET))
+         || targetm_common.except_unwind_info (&global_options) != UI_TARGET))
     return;
 
   fnsec = function_section (current_function_decl);
@@ -4244,7 +4245,7 @@ dwarf2out_frame_init (void)
   dwarf2out_def_cfa (NULL, STACK_POINTER_REGNUM, INCOMING_FRAME_SP_OFFSET);
 
   if (targetm.debug_unwind_info () == UI_DWARF2
-      || targetm.except_unwind_info (&global_options) == UI_DWARF2)
+      || targetm_common.except_unwind_info (&global_options) == UI_DWARF2)
     initial_return_save (INCOMING_RETURN_ADDR_RTX);
 }
 
@@ -4257,7 +4258,7 @@ dwarf2out_frame_finish (void)
 
   /* Output another copy for the unwinder.  */
   if ((flag_unwind_tables || flag_exceptions)
-      && targetm.except_unwind_info (&global_options) == UI_DWARF2)
+      && targetm_common.except_unwind_info (&global_options) == UI_DWARF2)
     output_call_frame_info (1);
 }
 
@@ -23538,7 +23539,7 @@ dwarf2out_assembly_start (void)
   if (HAVE_GAS_CFI_SECTIONS_DIRECTIVE
       && dwarf2out_do_cfi_asm ()
       && (!(flag_unwind_tables || flag_exceptions)
-         || targetm.except_unwind_info (&global_options) != UI_DWARF2))
+         || targetm_common.except_unwind_info (&global_options) != UI_DWARF2))
     fprintf (asm_out_file, "\t.cfi_sections\t.debug_frame\n");
 }
 
index c13ab5f820b6da59ac788f308a22f2820ce642c7..bb16036d3618de4b07f6a8142f898ac189a9366a 100644 (file)
@@ -1,6 +1,6 @@
 /* Implements exception handling.
    Copyright (C) 1989, 1992, 1993, 1994, 1995, 1996, 1997, 1998,
-   1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010
+   1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011
    Free Software Foundation, Inc.
    Contributed by Mike Stump <mrs@cygnus.com>.
 
@@ -136,6 +136,7 @@ along with GCC; see the file COPYING3.  If not see
 #include "ggc.h"
 #include "tm_p.h"
 #include "target.h"
+#include "common/common-target.h"
 #include "langhooks.h"
 #include "cgraph.h"
 #include "diagnostic.h"
@@ -209,7 +210,7 @@ init_eh (void)
 
   /* Create the SjLj_Function_Context structure.  This should match
      the definition in unwind-sjlj.c.  */
-  if (targetm.except_unwind_info (&global_options) == UI_SJLJ)
+  if (targetm_common.except_unwind_info (&global_options) == UI_SJLJ)
     {
       tree f_jbuf, f_per, f_lsda, f_prev, f_cs, f_data, tmp;
 
@@ -1395,13 +1396,13 @@ finish_eh_generation (void)
   basic_block bb;
 
   /* Construct the landing pads.  */
-  if (targetm.except_unwind_info (&global_options) == UI_SJLJ)
+  if (targetm_common.except_unwind_info (&global_options) == UI_SJLJ)
     sjlj_build_landing_pads ();
   else
     dw2_build_landing_pads ();
   break_superblocks ();
 
-  if (targetm.except_unwind_info (&global_options) == UI_SJLJ
+  if (targetm_common.except_unwind_info (&global_options) == UI_SJLJ
       /* Kludge for Alpha/Tru64 (see alpha_gp_save_rtx).  */
       || single_succ_edge (ENTRY_BLOCK_PTR)->insns.r)
     commit_edge_insertions ();
@@ -2645,7 +2646,7 @@ gate_convert_to_eh_region_ranges (void)
   /* Nothing to do for SJLJ exceptions or if no regions created.  */
   if (cfun->eh->region_tree == NULL)
     return false;
-  if (targetm.except_unwind_info (&global_options) == UI_SJLJ)
+  if (targetm_common.except_unwind_info (&global_options) == UI_SJLJ)
     return false;
   return true;
 }
@@ -2834,7 +2835,7 @@ switch_to_exception_section (const char * ARG_UNUSED (fnname))
     {
       /* Compute the section and cache it into exception_section,
         unless it depends on the function name.  */
-      if (targetm.have_named_sections)
+      if (targetm_common.have_named_sections)
        {
          int flags;
 
@@ -2984,7 +2985,7 @@ output_one_function_exception_table (int section)
                       eh_data_format_name (tt_format));
 
 #ifndef HAVE_AS_LEB128
-  if (targetm.except_unwind_info (&global_options) == UI_SJLJ)
+  if (targetm_common.except_unwind_info (&global_options) == UI_SJLJ)
     call_site_len = sjlj_size_of_call_site_table ();
   else
     call_site_len = dw2_size_of_call_site_table (section);
@@ -3051,14 +3052,14 @@ output_one_function_exception_table (int section)
   dw2_asm_output_delta_uleb128 (cs_end_label, cs_after_size_label,
                                "Call-site table length");
   ASM_OUTPUT_LABEL (asm_out_file, cs_after_size_label);
-  if (targetm.except_unwind_info (&global_options) == UI_SJLJ)
+  if (targetm_common.except_unwind_info (&global_options) == UI_SJLJ)
     sjlj_output_call_site_table ();
   else
     dw2_output_call_site_table (cs_format, section);
   ASM_OUTPUT_LABEL (asm_out_file, cs_end_label);
 #else
   dw2_asm_output_data_uleb128 (call_site_len, "Call-site table length");
-  if (targetm.except_unwind_info (&global_options) == UI_SJLJ)
+  if (targetm_common.except_unwind_info (&global_options) == UI_SJLJ)
     sjlj_output_call_site_table ();
   else
     dw2_output_call_site_table (cs_format, section);
index 7387dad98df234ec27a13c4ffcfd019dbfd654cc..c7d818380332beceb8c3afb03e496f3327d9098b 100644 (file)
@@ -40,6 +40,7 @@ along with GCC; see the file COPYING3.  If not see
 #include "recog.h"
 #include "langhooks.h"
 #include "target.h"
+#include "common/common-target.h"
 #include "output.h"
 
 static rtx break_out_memory_refs (rtx);
index 971432c19af49f52e52ed6a9918b790f2ca31af4..c4bba281cd8c6cbd88f9314f32f06492382339a9 100644 (file)
@@ -49,6 +49,7 @@ along with GCC; see the file COPYING3.  If not see
 #include "tree-pass.h"
 #include "tree-flow.h"
 #include "target.h"
+#include "common/common-target.h"
 #include "timevar.h"
 #include "df.h"
 #include "diagnostic.h"
@@ -10298,7 +10299,7 @@ build_personality_function (const char *lang)
   tree decl, type;
   char *name;
 
-  switch (targetm.except_unwind_info (&global_options))
+  switch (targetm_common.except_unwind_info (&global_options))
     {
     case UI_NONE:
       return NULL;
index d5248730de1ec574ccb86f0f98fceac2ee2a9e03..81c4d39de470cb7e89ef78b01853a414ad14e1f2 100644 (file)
@@ -57,6 +57,7 @@ along with GCC; see the file COPYING3.  If not see
 #include "integrate.h"
 #include "langhooks.h"
 #include "target.h"
+#include "common/common-target.h"
 #include "cfglayout.h"
 #include "gimple.h"
 #include "tree-pass.h"
@@ -4968,7 +4969,7 @@ expand_function_end (void)
   /* Output the label for the actual return from the function.  */
   emit_label (return_label);
 
-  if (targetm.except_unwind_info (&global_options) == UI_SJLJ)
+  if (targetm_common.except_unwind_info (&global_options) == UI_SJLJ)
     {
       /* Let except.c know where it should emit the call to unregister
         the function context for sjlj exceptions.  */
@@ -5127,7 +5128,7 @@ expand_function_end (void)
      may trap are not moved into the epilogue by scheduling, because
      we don't always emit unwind information for the epilogue.  */
   if (cfun->can_throw_non_call_exceptions
-      && targetm.except_unwind_info (&global_options) != UI_SJLJ)
+      && targetm_common.except_unwind_info (&global_options) != UI_SJLJ)
     emit_insn (gen_blockage ());
 
   /* If stack protection is enabled for this function, check the guard.  */
index a5e56b14f689f2d7f791db22ed8d8af072c37b99..20385d1ea8ecc5c984e0cf46b67c05ff0e97fc6b 100644 (file)
@@ -1,3 +1,13 @@
+2011-06-14  Joseph Myers  <joseph@codesourcery.com>
+
+       * Make-lang.in (go/go-lang.o, go/go-backend.o): Update
+       dependencies.
+       * go-backend.c: Include common/common-target.h.
+       (go_write_export_data): Use targetm_common.have_named_sections.
+       * go-lang.c: Include common/common-target.h.
+       (go_langhook_init_options_struct): Use
+       targetm_common.supports_split_stack.
+
 2011-06-13  Ian Lance Taylor  <iant@google.com>
 
        * Make-lang.in (go/expressions.o): Depend on $(GO_RUNTIME_H).
index 51760bf510710da13de0710101467a680283b7b4..26c16194d7f9708d2eb79ecbd56c1d1f943be5f9 100644 (file)
@@ -224,13 +224,14 @@ GO_IMPORT_H = go/gofrontend/import.h go/gofrontend/export.h
 GO_RUNTIME_H = go/gofrontend/runtime.h go/gofrontend/runtime.def
 
 go/go-backend.o: go/go-backend.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \
-       $(TM_H) $(RTL_H) $(TREE_H) $(TM_P_H) output.h $(TARGET_H)
+       $(TM_H) $(RTL_H) $(TREE_H) $(TM_P_H) output.h $(TARGET_H) \
+       $(COMMON_TARGET_H)
 
 go/go-lang.o: go/go-lang.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(OPTS_H) \
                $(TREE_H) $(GIMPLE_H) $(GGC_H) $(TOPLEV_H) debug.h options.h \
                $(FLAGS_H) convert.h $(DIAGNOSTIC_H) langhooks.h \
                $(LANGHOOKS_DEF_H) $(EXCEPT_H) $(TARGET_H) $(GO_C_H) \
-               gt-go-go-lang.h gtype-go.h
+               gt-go-go-lang.h gtype-go.h $(COMMON_TARGET_H)
        $(COMPILER) $(ALL_COMPILERFLAGS) $(ALL_CPPFLAGS) \
          -DDEFAULT_TARGET_VERSION=\"$(version)\" \
          -DDEFAULT_TARGET_MACHINE=\"$(target_noncanonical)\" \
index 60a97db7df4e295ce7f391d33c67d2897773bed1..62102a2e08bca62fc0d92b8c6ba7b44a7c4b8d9a 100644 (file)
@@ -26,6 +26,7 @@ along with GCC; see the file COPYING3.  If not see
 #include "tm_p.h"
 #include "output.h"
 #include "target.h"
+#include "common/common-target.h"
 
 #include "go-c.h"
 
@@ -103,7 +104,7 @@ go_write_export_data (const char *bytes, unsigned int size)
 
   if (sec == NULL)
     {
-      gcc_assert (targetm.have_named_sections);
+      gcc_assert (targetm_common.have_named_sections);
       sec = get_section (".go_export", SECTION_DEBUG, NULL);
     }
 
index 4687c6e19ba8f508f040ab41059a9b2e2b8adfaf..576e35f75510545d9f9d2ee8e13a4aad9d7f5c9f 100644 (file)
@@ -35,6 +35,7 @@ along with GCC; see the file COPYING3.  If not see
 #include "langhooks-def.h"
 #include "except.h"
 #include "target.h"
+#include "common/common-target.h"
 
 #include <mpfr.h>
 
@@ -143,7 +144,7 @@ go_langhook_init_options_struct (struct gcc_options *opts)
   opts->frontend_set_flag_errno_math = true;
 
   /* We turn on stack splitting if we can.  */
-  if (targetm.supports_split_stack (false, opts))
+  if (targetm_common.supports_split_stack (false, opts))
     opts->x_flag_split_stack = 1;
 
   /* Exceptions are used to handle recovering from panics.  */
index 0cb329077bb3219246aa62c573a3ccf67d9158eb..407b626d60d234ed91eb63414cb80f4a0d916aa6 100644 (file)
@@ -141,6 +141,7 @@ along with GCC; see the file COPYING3.  If not see
 #include "recog.h"
 #include "sched-int.h"
 #include "target.h"
+#include "common/common-target.h"
 #include "output.h"
 #include "params.h"
 #include "vecprim.h"
@@ -4503,7 +4504,7 @@ sched_create_recovery_edges (basic_block first_bb, basic_block rec,
     {
       /* Rewritten from cfgrtl.c.  */
       if (flag_reorder_blocks_and_partition
-         && targetm.have_named_sections)
+         && targetm_common.have_named_sections)
        {
          /* We don't need the same note for the check because
             any_condjump_p (check) == true.  */
index 3cff0ee7430d0d6f07212ae7811585c70e0496e8..296739ed73839a77eb4959ceaed56591f9ef0a27 100644 (file)
@@ -30,7 +30,7 @@ along with GCC; see the file COPYING3.  If not see
 #include "flags.h"
 #include "opts.h"
 #include "options.h"
-#include "target.h"
+#include "common/common-target.h"
 #include "diagnostic.h"
 #include "lto-streamer.h"
 
@@ -405,8 +405,8 @@ lto_reissue_options (void)
        {
          struct cl_decoded_option decoded;
          generate_option (o->code, o->arg, o->value, CL_TARGET, &decoded);
-         targetm.handle_option (&global_options, &global_options_set,
-                                &decoded, UNKNOWN_LOCATION);
+         targetm_common.handle_option (&global_options, &global_options_set,
+                                       &decoded, UNKNOWN_LOCATION);
        }
       else if (o->type == CL_COMMON)
        gcc_assert (flag_var);
index 712425eb928ef20e7ab2228a19b5832fcd44846b..e9b433454c7dd9466f6719a581417f5095e39bf3 100644 (file)
@@ -35,6 +35,7 @@ along with GCC; see the file COPYING3.  If not see
 #include "opts-diagnostic.h"
 #include "insn-attr.h"         /* For INSN_SCHEDULING and DELAY_SLOTS.  */
 #include "target.h"
+#include "common/common-target.h"
 
 /* Parse the -femit-struct-debug-detailed option value
    and set the flag variables. */
@@ -231,7 +232,7 @@ target_handle_option (struct gcc_options *opts,
 {
   gcc_assert (dc == global_dc);
   gcc_assert (kind == DK_UNSPECIFIED);
-  return targetm.handle_option (opts, opts_set, decoded, loc);
+  return targetm_common.handle_option (opts, opts_set, decoded, loc);
 }
 
 /* Add comma-separated strings to a char_p vector.  */
@@ -295,15 +296,15 @@ init_options_struct (struct gcc_options *opts, struct gcc_options *opts_set)
      is set after target options have been processed.  */
   opts->x_flag_short_enums = 2;
 
-  /* Initialize target_flags before targetm.target_option.optimization
+  /* Initialize target_flags before default_options_optimization
      so the latter can modify it.  */
-  opts->x_target_flags = targetm.default_target_flags;
+  opts->x_target_flags = targetm_common.default_target_flags;
 
   /* Some targets have ABI-specified unwind tables.  */
-  opts->x_flag_unwind_tables = targetm.unwind_tables_default;
+  opts->x_flag_unwind_tables = targetm_common.unwind_tables_default;
 
   /* Some targets have other target-specific initialization.  */
-  targetm.target_option.init_struct (opts);
+  targetm_common.option_init_struct (opts);
 }
 
 /* If indicated by the optimization level LEVEL (-Os if SIZE is set,
@@ -596,7 +597,7 @@ default_options_optimization (struct gcc_options *opts,
 
   /* Allow default optimizations to be specified on a per-machine basis.  */
   maybe_default_options (opts, opts_set,
-                        targetm.target_option.optimization_table,
+                        targetm_common.option_optimization_table,
                         opts->x_optimize, opts->x_optimize_size,
                         opts->x_optimize_fast, lang_mask, handlers, loc, dc);
 }
@@ -700,7 +701,7 @@ finish_options (struct gcc_options *opts, struct gcc_options *opts_set,
      generating unwind info.  If opts->x_flag_exceptions is turned on
      we need to turn off the partitioning optimization.  */
 
-  ui_except = targetm.except_unwind_info (opts);
+  ui_except = targetm_common.except_unwind_info (opts);
 
   if (opts->x_flag_exceptions
       && opts->x_flag_reorder_blocks_and_partition
@@ -717,7 +718,7 @@ finish_options (struct gcc_options *opts, struct gcc_options *opts_set,
      optimization.  */
 
   if (opts->x_flag_unwind_tables
-      && !targetm.unwind_tables_default
+      && !targetm_common.unwind_tables_default
       && opts->x_flag_reorder_blocks_and_partition
       && (ui_except == UI_SJLJ || ui_except == UI_TARGET))
     {
@@ -733,9 +734,9 @@ finish_options (struct gcc_options *opts, struct gcc_options *opts_set,
      support named sections.  */
 
   if (opts->x_flag_reorder_blocks_and_partition
-      && (!targetm.have_named_sections
+      && (!targetm_common.have_named_sections
          || (opts->x_flag_unwind_tables
-             && targetm.unwind_tables_default
+             && targetm_common.unwind_tables_default
              && (ui_except == UI_SJLJ || ui_except == UI_TARGET))))
     {
       inform (loc,
@@ -795,7 +796,7 @@ finish_options (struct gcc_options *opts, struct gcc_options *opts_set,
     opts->x_flag_split_stack = 0;
   else if (opts->x_flag_split_stack)
     {
-      if (!targetm.supports_split_stack (true, opts))
+      if (!targetm_common.supports_split_stack (true, opts))
        {
          error_at (loc, "%<-fsplit-stack%> is not supported by "
                    "this compiler configuration");
index cb258afea9be0214e3085d82bb9d6a38a644aa13..53ca29ca46d745080378ef2358aed836ae85b6e1 100644 (file)
@@ -1,3 +1,7 @@
+2011-06-14  Joseph Myers  <joseph@codesourcery.com>
+
+       * exgettext: Handle common/ directory and subdirectories.
+
 2011-05-23  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>
 
        * EXCLUDES: Remove gthr-gnat.c, gthr-gnat.h.
index 7642dc56aadcd8b98bef6cef7e51e5f0baa367d3..a7bbf185a04f126b62e4a5037353ea75f57ea745 100644 (file)
@@ -72,6 +72,9 @@ pottmp=$pwd/$T/tmp.pot
 # Locate files to scan.  We scan the following directories:
 #  $srcdir
 #  $srcdir/c-family
+#  $srcdir/common
+#  $srcdir/common/config
+#  $srcdir/common/config/*
 #  $srcdir/config
 #  $srcdir/config/*
 #  all subdirectories of $srcdir containing a config-lang.in file, and
@@ -91,7 +94,8 @@ echo "scanning for keywords, %e and %n strings..." >&2
 
 ( cd $srcdir
   lang_subdirs=`echo */config-lang.in */*/config-lang.in | sed -e 's|/config-lang\.in||g'`
-  { for dir in "" c-family/ config/ config/*/ \
+  { for dir in "" c-family/ common/ common/config/ common/config/*/ \
+      config/ config/*/ \
       `find $lang_subdirs -type d -print | fgrep -v .svn | sort | sed -e 's|$|/|'`
     do  for glob in '*.c' '*.cc' '*.h' '*.def'
         do  eval echo $dir$glob
index bf3a8cb8ea2c1627f94332a05f86fc81a8c4204e..8609512220887e8fc37b37f049f7479e75595e00 100644 (file)
@@ -1,6 +1,6 @@
 /* Default initializers for a generic GCC target.
-   Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010
-   Free Software Foundation, Inc.
+   Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010,
+   2011 Free Software Foundation, Inc.
 
    This program is free software; you can redistribute it and/or modify it
    under the terms of the GNU General Public License as published by the
 # endif
 #endif
 
-#ifdef TARGET_ASM_NAMED_SECTION
-#define TARGET_HAVE_NAMED_SECTIONS true
-#endif
-
 #ifndef TARGET_TERMINATE_DW2_EH_FRAME_INFO
 #ifdef EH_FRAME_SECTION_NAME
 #define TARGET_TERMINATE_DW2_EH_FRAME_INFO false
index 3215bd3ddcfa39c13ef547c87a635c7e984d41fe..1ea59078b08a3f29300b7ece86c337b29e1ecf8f 100644 (file)
@@ -1012,12 +1012,6 @@ HOOK_VECTOR_END (vectorize)
 #undef HOOK_PREFIX
 #define HOOK_PREFIX "TARGET_"
 
-/* The initial value of target_flags.  */
-DEFHOOKPOD
-(default_target_flags,
- "",
- int, 0)
-
 /* Allow target specific overriding of option settings after options have
   been changed by an attribute or pragma or when it is reset at the
   end of the code affected by an attribute or pragma.  */
@@ -1027,16 +1021,6 @@ DEFHOOK
  void, (void),
  hook_void_void)
 
-/* Handle target switch DECODED for options structures OPTS and
-   OPTS_SET, at location LOC.  Return true if the switch was valid.  */
-DEFHOOK
-(handle_option,
- "",
- bool, (struct gcc_options *opts, struct gcc_options *opts_set,
-       const struct cl_decoded_option *decoded,
-       unsigned int /*location_t*/ loc),
- default_target_handle_option)
-
 /* Display extra, target specific information in response to a
    --target-help switch.  */
 DEFHOOK
@@ -1876,17 +1860,6 @@ DEFHOOK
  tree, (void),
  default_external_stack_protect_fail)
 
-DEFHOOK
-(supports_split_stack,
- "Whether this target supports splitting the stack when the options\
- described in @var{opts} have been passed.  This is called\
- after options have been parsed, so the target may reject splitting\
- the stack in some configurations.  The default version of this hook\
- returns false.  If @var{report} is true, this function may issue a warning\
- or error; if @var{report} is false, it must simply return a value",
- bool, (bool report, struct gcc_options *opts),
- hook_bool_bool_gcc_optionsp_false)
-
 /* Returns NULL if target supports the insn within a doloop block,
    otherwise it returns an error message.  */
 DEFHOOK
@@ -2579,12 +2552,6 @@ DEFHOOK
  void, (void),
  hook_void_void)
 
-/* Set default optimizations for the target.  */
-DEFHOOKPOD
-(optimization_table,
- "",
- const struct default_options *, empty_optimization_table)
-
 DEFHOOK
 (default_params,
 "Set target-dependent default values for @option{--param} settings, using\
@@ -2592,12 +2559,6 @@ DEFHOOK
  void, (void),
  hook_void_void)
 
-DEFHOOK
-(init_struct,
-"Set target-dependent initial values of fields in @var{opts}.",
- void, (struct gcc_options *opts),
- hook_void_gcc_optionsp)
-
 /* Function to determine if one function can inline another function.  */
 #undef HOOK_PREFIX
 #define HOOK_PREFIX "TARGET_"
@@ -2625,27 +2586,8 @@ DEFHOOK
  enum unwind_info_type, (void),
  default_debug_unwind_info)
 
-/* Determine the type of unwind info to emit for exceptions.  */
-DEFHOOK
-(except_unwind_info,
- "",
- enum unwind_info_type, (struct gcc_options *opts),
- default_except_unwind_info)
-
 /* Leave the boolean fields at the end.  */
 
-/* True if unwinding tables should be generated by default.  */
-DEFHOOKPOD
-(unwind_tables_default,
- "",
- bool, false)
-
-/* True if arbitrary sections are supported.  */
-DEFHOOKPOD
-(have_named_sections,
- "",
- bool, false)
-
 /* True if we can create zeroed data by switching to a BSS section
    and then using ASM_OUTPUT_SKIP to allocate the space.  */
 DEFHOOKPOD
index eae0b76a8995c52912ee622fc6770a1a619598a1..707fbef6ad6fcbca6435e5ea91faa719c471dfcd 100644 (file)
@@ -131,41 +131,6 @@ enum vect_cost_for_stmt
   vec_perm
 };
 
-/* Sets of optimization levels at which an option may be enabled by
-   default_options_optimization.  */
-enum opt_levels
-{
-  OPT_LEVELS_NONE, /* No levels (mark end of array).  */
-  OPT_LEVELS_ALL, /* All levels (used by targets to disable options
-                    enabled in target-independent code).  */
-  OPT_LEVELS_0_ONLY, /* -O0 only.  */
-  OPT_LEVELS_1_PLUS, /* -O1 and above, including -Os.  */
-  OPT_LEVELS_1_PLUS_SPEED_ONLY, /* -O1 and above, but not -Os.  */
-  OPT_LEVELS_2_PLUS, /* -O2 and above, including -Os.  */
-  OPT_LEVELS_2_PLUS_SPEED_ONLY, /* -O2 and above, but not -Os.  */
-  OPT_LEVELS_3_PLUS, /* -O3 and above.  */
-  OPT_LEVELS_3_PLUS_AND_SIZE, /* -O3 and above and -Os.  */
-  OPT_LEVELS_SIZE, /* -Os only.  */
-  OPT_LEVELS_FAST /* -Ofast only.  */
-};
-
-/* Description of options to enable by default at given levels.  */
-struct default_options
-{
-  /* The levels at which to enable the option.  */
-  enum opt_levels levels;
-
-  /* The option index and argument or enabled/disabled sense of the
-     option, as passed to handle_generated_option.  If ARG is NULL and
-     the option allows a negative form, the option is considered to be
-     passed in negative form when the optimization level is not one of
-     those in LEVELS (in order to handle changes to the optimization
-     level with the "optimize" attribute).  */
-  size_t opt_index;
-  const char *arg;
-  int value;
-};
-
 /* The target structure.  This holds all the backend hooks.  */
 #define DEFHOOKPOD(NAME, DOC, TYPE, INIT) TYPE NAME;
 #define DEFHOOK(NAME, DOC, TYPE, PARAMS, INIT) TYPE (* NAME) PARAMS;
index 48d19a05416b0c86b28a66d60919f71c8c5286da..6ecb3898baf6f53790b5e9a8c132ea7a9aa7e2b8 100644 (file)
@@ -1323,48 +1323,6 @@ default_debug_unwind_info (void)
   return UI_NONE;
 }
 
-/* Determine the exception handling mechanism for the target.  */
-
-enum unwind_info_type
-default_except_unwind_info (struct gcc_options *opts ATTRIBUTE_UNUSED)
-{
-  /* Obey the configure switch to turn on sjlj exceptions.  */
-#ifdef CONFIG_SJLJ_EXCEPTIONS
-  if (CONFIG_SJLJ_EXCEPTIONS)
-    return UI_SJLJ;
-#endif
-
-  /* ??? Change all users to the hook, then poison this.  */
-#ifdef DWARF2_UNWIND_INFO
-  if (DWARF2_UNWIND_INFO)
-    return UI_DWARF2;
-#endif
-
-  return UI_SJLJ;
-}
-
-/* To be used by targets that force dwarf2 unwind enabled.  */
-
-enum unwind_info_type
-dwarf2_except_unwind_info (struct gcc_options *opts ATTRIBUTE_UNUSED)
-{
-  /* Obey the configure switch to turn on sjlj exceptions.  */
-#ifdef CONFIG_SJLJ_EXCEPTIONS
-  if (CONFIG_SJLJ_EXCEPTIONS)
-    return UI_SJLJ;
-#endif
-
-  return UI_DWARF2;
-}
-
-/* To be used by targets that force sjlj unwind enabled.  */
-
-enum unwind_info_type
-sjlj_except_unwind_info (struct gcc_options *opts ATTRIBUTE_UNUSED)
-{
-  return UI_SJLJ;
-}
-
 /* To be used by targets where reg_raw_mode doesn't return the right
    mode for registers used in apply_builtin_return and apply_builtin_arg.  */
 
@@ -1483,20 +1441,4 @@ default_pch_valid_p (const void *data_p, size_t len)
   return NULL;
 }
 
-/* Default version of TARGET_HANDLE_OPTION.  */
-
-bool
-default_target_handle_option (struct gcc_options *opts ATTRIBUTE_UNUSED,
-                             struct gcc_options *opts_set ATTRIBUTE_UNUSED,
-                             const struct cl_decoded_option *decoded ATTRIBUTE_UNUSED,
-                             location_t loc ATTRIBUTE_UNUSED)
-{
-  return true;
-}
-
-const struct default_options empty_optimization_table[] =
-  {
-    { OPT_LEVELS_NONE, 0, NULL, 0 }
-  };
-
 #include "gt-targhooks.h"
index 93f86bfe4b05d5f022f1e05d7df1f35505aaf4b5..a1cc3281ac70e5ac34b60f75d55d35e0a30ca586 100644 (file)
@@ -163,9 +163,6 @@ extern reg_class_t default_preferred_rename_class (reg_class_t rclass);
 extern bool default_class_likely_spilled_p (reg_class_t);
 
 extern enum unwind_info_type default_debug_unwind_info (void);
-extern enum unwind_info_type default_except_unwind_info (struct gcc_options *);
-extern enum unwind_info_type dwarf2_except_unwind_info (struct gcc_options *);
-extern enum unwind_info_type sjlj_except_unwind_info (struct gcc_options *);
 
 extern int default_label_align_after_barrier_max_skip (rtx);
 extern int default_loop_align_max_skip (rtx);
@@ -175,12 +172,5 @@ extern section * default_function_section(tree decl, enum node_frequency freq,
                                          bool startup, bool exit);
 extern enum machine_mode default_get_reg_raw_mode(int);
 
-extern const struct default_options empty_optimization_table[];
-
-extern bool default_target_handle_option (struct gcc_options *,
-                                         struct gcc_options *,
-                                         const struct cl_decoded_option *,
-                                         location_t);
-
 extern void *default_get_pch_validity (size_t *);
 extern const char *default_pch_valid_p (const void *, size_t);
index 6c992cf21b7d4427469248646a097be03b8ce8a3..2597140b58c904907bb0b0fbae67e44bbeb8f150 100644 (file)
@@ -62,6 +62,7 @@ along with GCC; see the file COPYING3.  If not see
 #include "integrate.h"
 #include "debug.h"
 #include "target.h"
+#include "common/common-target.h"
 #include "langhooks.h"
 #include "cfglayout.h"
 #include "cfgloop.h"
@@ -1512,7 +1513,7 @@ process_options (void)
        fatal_error ("can%'t open %s: %m", aux_info_file_name);
     }
 
-  if (! targetm.have_named_sections)
+  if (!targetm_common.have_named_sections)
     {
       if (flag_function_sections)
        {
index 39a9067101e3872f7f2e13057131573e4fcd03ef..87fc566ddee2f3fa7b4c16a8ebcc9d76cdf67f26 100644 (file)
@@ -1,5 +1,5 @@
 /* Tail call optimization on trees.
-   Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010
+   Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011
    Free Software Foundation, Inc.
 
 This file is part of GCC.
@@ -35,6 +35,7 @@ along with GCC; see the file COPYING3.  If not see
 #include "langhooks.h"
 #include "dbgcnt.h"
 #include "target.h"
+#include "common/common-target.h"
 
 /* The file implements the tail recursion elimination.  It is also used to
    analyze the tail calls in general, passing the results to the rtl level
@@ -152,7 +153,7 @@ suitable_for_tail_call_opt_p (void)
   /* If we are using sjlj exceptions, we may need to add a call to
      _Unwind_SjLj_Unregister at exit of the function.  Which means
      that we cannot do any sibcall transformations.  */
-  if (targetm.except_unwind_info (&global_options) == UI_SJLJ
+  if (targetm_common.except_unwind_info (&global_options) == UI_SJLJ
       && current_function_has_exception_handlers ())
     return false;
 
index 21e7a2bced1fece4b44cfd95b3d3342bd8873884..73126cf30d69ba03c4e36ce67f0bce89bcac00de 100644 (file)
@@ -44,6 +44,7 @@ along with GCC; see the file COPYING3.  If not see
 #include "filenames.h"
 #include "output.h"
 #include "target.h"
+#include "common/common-target.h"
 #include "langhooks.h"
 #include "tree-inline.h"
 #include "tree-iterator.h"
@@ -9476,7 +9477,7 @@ build_common_builtin_nodes (void)
   ftype = build_function_type_list (void_type_node, ptr_type_node, NULL_TREE);
   local_define_builtin ("__builtin_unwind_resume", ftype,
                        BUILT_IN_UNWIND_RESUME,
-                       ((targetm.except_unwind_info (&global_options)
+                       ((targetm_common.except_unwind_info (&global_options)
                          == UI_SJLJ)
                         ? "_Unwind_SjLj_Resume" : "_Unwind_Resume"),
                        ECF_NORETURN);
index a0a0582be76ee4f0f22a58700d7c949527b5dc11..cfdf8d7d13ef22af97a692b664f015d47a5e5494 100644 (file)
@@ -46,6 +46,7 @@ along with GCC; see the file COPYING3.  If not see
 #include "tm_p.h"
 #include "debug.h"
 #include "target.h"
+#include "common/common-target.h"
 #include "targhooks.h"
 #include "tree-mudflap.h"
 #include "cgraph.h"
@@ -416,7 +417,7 @@ resolve_unique_section (tree decl, int reloc ATTRIBUTE_UNUSED,
                        int flag_function_or_data_sections)
 {
   if (DECL_SECTION_NAME (decl) == NULL_TREE
-      && targetm.have_named_sections
+      && targetm_common.have_named_sections
       && (flag_function_or_data_sections
          || DECL_ONE_ONLY (decl)))
     {
@@ -464,7 +465,7 @@ hot_function_section (tree decl)
 {
   if (decl != NULL_TREE
       && DECL_SECTION_NAME (decl) != NULL_TREE
-      && targetm.have_named_sections)
+      && targetm_common.have_named_sections)
     return get_named_section (decl, NULL, 0);
   else
     return text_section;
@@ -536,7 +537,7 @@ default_function_section (tree decl, enum node_frequency freq,
 #endif
 
   if (!flag_reorder_functions
-      || !targetm.have_named_sections)
+      || !targetm_common.have_named_sections)
     return NULL;
   /* Startup code should go to startup subsection unless it is
      unlikely executed (this happens especially with function splitting