This patch fixes a long standing bug that David noticed, namely if you don't use -mcpu=<xxx>, the target options that are set by the configuration .h files in TARGET_DEFAULT are cleared if they are in POWERPC_MASKS. Note, if you configure the compiler using --with-cpu=<xxx>, it provides a default cpu, so users using pre-packaged compilers, typically would not see the bug.
In adding the support for the above change, I also tweaked the debug output for -mdebug=reg so it prints more information about the switches set. Other than that, this is the same patch that I previously submitted. I have done the bootstrap and make check with no regressions. I have also built special compilers without --with-cpu to make sure the changes were correctly propigated. Are these patches ok to install? 2012-09-27 Michael Meissner <meiss...@linux.vnet.ibm.com> * common/config/rs6000/rs6000-common.c (rs6000_handle_option): Move all switches that set target_flags to set rs6000_isa_flags, and make it HOST_WIDE_INT. Save/restore new option words. Add TARGET_<xxx> maps for OPTION_<xxx>. Add MASK_<xxx> maps for OPTION_MASK_<xxx>. Print more debug output for -mdebug=reg. Move masks for different cpu levels to rs6000-cpus.def. Turn off VSX if the assembler doesn't support Altivec. Change #ifdef TARGET_<xxx> to #ifdef OPTION_<xxx>. If no -mcpu=<xxx> was used, use all of the bits in TARGET_DEFAULT for the isa bits. * gcc/config/rs6000/aix43.h (SUBTARGET_OVERRIDE_OPTIONS): Likewise. * gcc/config/rs6000/aix51.h (SUBTARGET_OVERRIDE_OPTIONS): Likewise. * gcc/config/rs6000/aix52.h (SUBTARGET_OVERRIDE_OPTIONS): Likewise. * gcc/config/rs6000/aix53.h (SUBTARGET_OVERRIDE_OPTIONS): Likewise. * gcc/config/rs6000/aix61.h (SUBTARGET_OVERRIDE_OPTIONS): Likewise. * gcc/config/rs6000/aix64.opt (-maix64): Likewise. (-maix32): Likewise. * gcc/config/rs6000/darwin.opt (-m64): Likewise. (-m32): Likewise. * gcc/config/rs6000/freebsd.h (RELOCATABLE_NEEDS_FIXUP): Likewise. * gcc/config/rs6000/freebsd64.h (RELOCATABLE_NEEDS_FIXUP): Likewise. (SUBSUBTARGET_OVERRIDE_OPTIONS): Likewise. * gcc/config/rs6000/linux.h (RELOCATABLE_NEEDS_FIXUP): Likewise. * gcc/config/rs6000/linux64.h (RELOCATABLE_NEEDS_FIXUP): Likewise. (SUBSUBTARGET_OVERRIDE_OPTIONS): Likewise. (OPTION_LITTLE_ENDIAN): Likewise. (OPTION_RELOCATABLE): Likewise. (OPTION_EABI): Likewise. (OPTION_PROTOTYPE): Likewise. * gcc/config/rs6000/option-defaults.h (OPTION_MASK_64BIT): Likewise. (OPT_ARCH32): Likewise. (OPT_ARCH64): Likewise. * gcc/config/rs6000/rs6000-c.c (rs6000_target_modify_macros): Likewise. (rs6000_cpu_cpp_builtins): Likewise. * gcc/config/rs6000/rs6000-cpus.def (ISA_2_1_MASKS): Likewise. (ISA_2_2_MASKS): Likewise. (ISA_2_4_MASKS): Likewise. (ISA_2_5_MASKS_EMBEDDED): Likewise. (ISA_2_5_MASKS_SERVER): Likewise. (ISA_2_6_MASKS_EMBEDDED): Likewise. (ISA_2_6_MASKS_SERVER): Likewise. (POWERPC_7400_MASK): Likewise. (POWERPC_MASKS): Likewise. * gcc/config/rs6000/rs6000-protos.h (rs6000_builtin_mask_calculate): Likewise. (rs6000_target_modify_macros): Likewise. (rs6000_target_modify_macros_ptr): Likewise. * gcc/config/rs6000/rs6000.c (struct builtin_description): Likewise. (rs6000_target_modify_macros_ptr): Likewise. (struct rs6000_builtin_info): Likewise. (ISA_2_1_MASKS): Likewise. (ISA_2_2_MASKS): Likewise. (ISA_2_4_MASKS): Likewise. (ISA_2_5_MASKS_EMBEDDED): Likewise. (ISA_2_5_MASKS_SERVER): Likewise. (ISA_2_6_MASKS_EMBEDDED): Likewise. (ISA_2_6_MASKS_SERVER): Likewise. (POWERPC_7400_MASK): Likewise. (POWERPC_MASKS): Likewise. (OPTION_MASK_STRICT_ALIGN): Likewise. (struct rs6000_ptt): Likewise. (DEBUG_FMT_ID): Likewise. (DEBUG_FMT_D): Likewise. (DEBUG_FMT_X): Likewise. (DEBUG_FMT_WX): Likewise. (DEBUG_FMT_WX2): Likewise. (DEBUG_FMT_S): Likewise. (rs6000_debug_reg_global): Likewise. (darwin_rs6000_override_options): Likewise. (rs6000_builtin_mask_calculate): Likewise. (rs6000_option_override_internal): Likewise. (rs6000_init_hard_regno_mode_ok): Likewise. (paired_expand_builtin): Likewise. (spe_expand_builtin): Likewise. (rs6000_invalid_builtin): Likewise. (rs6000_expand_builtin): Likewise. (rs6000_builtin_decl): Likewise. (rs6000_common_init_builtins): Likewise. (rs6000_darwin_file_start): Likewise. (struct rs6000_opt_mask): Likewise. (rs6000_opt_masks): Likewise. (rs6000_inner_target_options): Likewise. (rs6000_pragma_target_parse): Likewise. (rs6000_function_specific_save): Likewise. (rs6000_function_specific_restore): Likewise. (rs6000_function_specific_print): Likewise. (rs6000_print_isa_or_misc_options): Likewise. (rs6000_print_isa_options): Likewise. (rs6000_can_inline_p): Likewise. * gcc/config/rs6000/rs6000.h (MASK_64BIT): Likewise. (MASK_ALTIVEC): Likewise. (MASK_CMPB): Likewise. (MASK_DFP): Likewise. (MASK_DLMZB): Likewise. (MASK_EABI): Likewise. (MASK_FPRND): Likewise. (MASK_HARD_FLOAT): Likewise. (MASK_ISEL): Likewise. (MASK_LITTLE_ENDIAN): Likewise. (MASK_MFCRF): Likewise. (MASK_MFPGPR): Likewise. (MASK_MINIMAL_TOC): Likewise. (MASK_MULHW): Likewise. (MASK_MULTIPLE): Likewise. (MASK_NO_UPDATE): Likewise. (MASK_POPCNTB): Likewise. (MASK_POPCNTD): Likewise. (MASK_POWERPC64): Likewise. (MASK_PPC_GFXOPT): Likewise. (MASK_PPC_GPOPT): Likewise. (MASK_PROTOTYPE): Likewise. (MASK_RECIP_PRECISION): Likewise. (MASK_REGNAMES): Likewise. (MASK_RELOCATABLE): Likewise. (MASK_SOFT_FLOAT): Likewise. (MASK_STRICT_ALIGN): Likewise. (MASK_STRING): Likewise. (MASK_UPDATE): Likewise. (MASK_VSX): Likewise. (OPTION_CMPB): Likewise. (OPTION_DFP): LIkewise. (OPTION_FPRND): Likewise. (OPTION_MFCRF): Likewise. (OPTION_MFPGPR): Likewise. (OPTION_POPCNTB): Likewise. (OPTION_POPCNTD): Likewise. (TARGET_64BIT): Likewise. (TARGET_ALTIVEC): Likewise. (TARGET_CMPB): Likewise. (TARGET_DFP): Likewise. (TARGET_DLMZB): Likewise. (TARGET_EABI): Likewise. (TARGET_FPRND): Likewise. (TARGET_HARD_FLOAT): Likewise. (TARGET_ISEL): Likewise. (TARGET_LITTLE_ENDIAN): Likewise. (TARGET_MFCRF): Likewise. (TARGET_MFPGPR): Likewise. (TARGET_MINIMAL_TOC): Likewise. (TARGET_MULHW): Likewise. (TARGET_MULTIPLE): Likewise. (TARGET_NO_UPDATE): Likewise. (TARGET_POPCNTB): Likewise. (TARGET_POPCNTD): Likewise. (TARGET_POWERPC64): Likewise. (TARGET_PPC_GFXOPT): Likewise. (TARGET_PPC_GPOPT): Likewise. (TARGET_PROTOTYPE): Likewise. (TARGET_RECIP_PRECISION): Likewise. (TARGET_REGNAMES): Likewise. (TARGET_RELOCATABLE): Likewise. (TARGET_SOFT_FLOAT): Likewise. (TARGET_STRICT_ALIGN): Likewise. (TARGET_STRING): Likewise. (TARGET_UPDATE): Likewise. (TARGET_VSX): Likewise. * gcc/config/rs6000/rs6000.opt (rs6000_isa_flags): Likewise. (x_rs6000_isa_flags): Likewise. (x_rs6000_ins_flags_explicit): Likewise. (rs6000_builtin_mask): Likewise. (target_flags_explicit): Likewise. (-mpowerpc64): Likewise. (-mpowerpc-gpopt): Likewise. (-mpowerpc-gfxopt): Likewise. (-mmfcrf): Likewise. (-mpopcntb): Likewise. (-mfprnd): Likewise. (-mcmpb): Likewise. (-mmfpgpr): Likewise. (-maltivec): Likewise. (-mhard-dfp): Likewise. (-mmulhw): Likewise. (-mdlmzb): Likewise. (-mmultiple): Likewise. (-mstring): Likewise. (-msoft-float): Likewise. (-mhard-float): Likewise. (-mpopcntd): Likewise. (-mvsx): Likewise. (-mno-update): Likewise. (-mupdate): Likewise. (-mrecip-precision): Likewise. (-mminimal-toc): Likewise. (-misel): Likewise. * gcc/config/rs6000/sysv4.h (TARGET_TOC): Likewise. (SUBTARGET_OVERRIDE_OPTIONS): Likewise. (SUBSUBTARGET_OVERRIDE_OPTIONS): Likewise. (TARGET_OS_SYSV_CPP_BUILTINS): Likewise. * gcc/config/rs6000/sysv4.opt (-mstrict-align): Likewise. (-mrelocatable): Likewise. (-mlittle-endian): Likewise. (-mlittle): Likewise. (-mbig-endian): Likewise. (-mbig): Likewise. (-meabi): Likewise. (-m64): Likewise. (-m32): Likewise. * config/rs6000/t-rs6000 (rs6000.o): Add rs6000-cpus.def dependency. -- Michael Meissner, IBM 5 Technology Place Drive, M/S 2757, Westford, MA 01886-3141, USA meiss...@linux.vnet.ibm.com fax +1 (978) 399-6899