From: Richard Earnshaw Date: Thu, 3 Nov 2016 18:08:19 +0000 (+0000) Subject: [arm] Eliminate SUBTARGET_CPU_DEFAULT X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=1bac673faf4a0a0bd0a5606dad9d98b33d568510;p=gcc.git [arm] Eliminate SUBTARGET_CPU_DEFAULT * config.gcc (arm-wrs-vxworks): Set target_cpu_cname. (arm*-freebsd*): Likewise. (arm*-*-netbsdelf*): Likewise. (arm*-*-linux*): Likewise. (arm*-*-uclinux*eabi*): Likewise. (arm*-*-phoenix*): Likewise. (arm*-*-eabi*, arm*-*-symbianelf*, arm*-*-rtems*): Likewise. (arm*-*-*): Don't clobber target_cpu_cname when --with-cpu is not specified. Default to arm6 if target_cpu_cname is not set. * arm/arm.c (arm_option_override): Simplify logic. Assert that the default cpu has been correctly configured. * arm/arm.h (TARGET_CPU_DEFAULT): Delete. (target_cpus): Delete TARGET_CPU_generic, add TARGET_CPU_num_cores. * arm/freebsd.h (SUBTARGET_CPU_DEFAULT): Delete. * arm/linux-eabi.h (SUBTARGET_CPU_DEFAULT): Delete. * arm/linux-elf.h (SUBTARGET_CPU_DEFAULT): Delete. * arm/symbian.h (SUBTARGET_CPU_DEFAULT): Delete. * arm/unknown-elf.h (SUBTARGET_CPU_DEFAULT): Delete. From-SVN: r241827 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index aa47e5db814..3888d217ed2 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,24 @@ +2016-11-03 Richard Earnshaw + + * config.gcc (arm-wrs-vxworks): Set target_cpu_cname. + (arm*-freebsd*): Likewise. + (arm*-*-netbsdelf*): Likewise. + (arm*-*-linux*): Likewise. + (arm*-*-uclinux*eabi*): Likewise. + (arm*-*-phoenix*): Likewise. + (arm*-*-eabi*, arm*-*-symbianelf*, arm*-*-rtems*): Likewise. + (arm*-*-*): Don't clobber target_cpu_cname when --with-cpu is not + specified. Default to arm6 if target_cpu_cname is not set. + * arm/arm.c (arm_option_override): Simplify logic. Assert that the + default cpu has been correctly configured. + * arm/arm.h (TARGET_CPU_DEFAULT): Delete. + (target_cpus): Delete TARGET_CPU_generic, add TARGET_CPU_num_cores. + * arm/freebsd.h (SUBTARGET_CPU_DEFAULT): Delete. + * arm/linux-eabi.h (SUBTARGET_CPU_DEFAULT): Delete. + * arm/linux-elf.h (SUBTARGET_CPU_DEFAULT): Delete. + * arm/symbian.h (SUBTARGET_CPU_DEFAULT): Delete. + * arm/unknown-elf.h (SUBTARGET_CPU_DEFAULT): Delete. + 2016-11-03 Jiong Wang * reg-notes.def (CFA_VAL_EXPRESSION): New entry. diff --git a/gcc/config/arm/arm.c b/gcc/config/arm/arm.c index 5add0d6443b..6dc2d2d6577 100644 --- a/gcc/config/arm/arm.c +++ b/gcc/config/arm/arm.c @@ -3104,17 +3104,7 @@ arm_option_override (void) arm_feature_set sought = ARM_FSET_EMPTY;; arm_selected_cpu = &all_cores[TARGET_CPU_DEFAULT]; - if (!arm_selected_cpu->name) - { -#ifdef SUBTARGET_CPU_DEFAULT - /* Use the subtarget default CPU if none was specified by - configure. */ - arm_selected_cpu = &all_cores[SUBTARGET_CPU_DEFAULT]; -#endif - /* Default to ARM6. */ - if (!arm_selected_cpu->name) - arm_selected_cpu = &all_cores[arm6]; - } + gcc_assert (arm_selected_cpu->name); sel = arm_selected_cpu; insn_flags = sel->flags; diff --git a/gcc/config/arm/arm.h b/gcc/config/arm/arm.h index b2d8422d494..3d11555d647 100644 --- a/gcc/config/arm/arm.h +++ b/gcc/config/arm/arm.h @@ -55,7 +55,8 @@ enum target_cpus TARGET_CPU_##INTERNAL_IDENT, #include "arm-cores.def" #undef ARM_CORE - TARGET_CPU_generic + /* Total number of CPUs we handle. */ + TARGET_CPU_num_cores }; /* The processor for which instructions should be scheduled. */ @@ -83,12 +84,6 @@ extern GTY(()) rtx arm_target_insn; /* Callback to output language specific object attributes. */ extern void (*arm_lang_output_object_attributes_hook)(void); -/* Just in case configure has failed to define anything. */ -#ifndef TARGET_CPU_DEFAULT -#define TARGET_CPU_DEFAULT TARGET_CPU_generic -#endif - - #undef CPP_SPEC #define CPP_SPEC "%(subtarget_cpp_spec) \ %{mfloat-abi=soft:%{mfloat-abi=hard: \ diff --git a/gcc/config/arm/freebsd.h b/gcc/config/arm/freebsd.h index 0ade4e99be1..949c397521c 100644 --- a/gcc/config/arm/freebsd.h +++ b/gcc/config/arm/freebsd.h @@ -112,14 +112,6 @@ #undef WCHAR_TYPE_SIZE #define WCHAR_TYPE_SIZE BITS_PER_WORD -#if defined (TARGET_FREEBSD_ARMv6) -#undef SUBTARGET_CPU_DEFAULT -#define SUBTARGET_CPU_DEFAULT TARGET_CPU_arm1176jzs -#else -#undef SUBTARGET_CPU_DEFAULT -#define SUBTARGET_CPU_DEFAULT TARGET_CPU_arm9 -#endif - /* FreeBSD 10 does not support unaligned access for armv6 and up. Unaligned access support was added in FreeBSD 11. */ #if FBSD_MAJOR < 11 diff --git a/gcc/config/arm/linux-eabi.h b/gcc/config/arm/linux-eabi.h index ace84816e06..9cfcf9fffd9 100644 --- a/gcc/config/arm/linux-eabi.h +++ b/gcc/config/arm/linux-eabi.h @@ -41,12 +41,6 @@ #undef ARM_DEFAULT_ABI #define ARM_DEFAULT_ABI ARM_ABI_AAPCS_LINUX -/* Default to armv5t so that thumb shared libraries work. - The ARM10TDMI core is the default for armv5t, so set - SUBTARGET_CPU_DEFAULT to achieve this. */ -#undef SUBTARGET_CPU_DEFAULT -#define SUBTARGET_CPU_DEFAULT TARGET_CPU_arm10tdmi - /* TARGET_BIG_ENDIAN_DEFAULT is set in config.gcc for big endian configurations. */ #undef TARGET_LINKER_EMULATION diff --git a/gcc/config/arm/linux-elf.h b/gcc/config/arm/linux-elf.h index a94bd2d2f8d..cc17b51eeab 100644 --- a/gcc/config/arm/linux-elf.h +++ b/gcc/config/arm/linux-elf.h @@ -45,8 +45,6 @@ #undef TARGET_DEFAULT #define TARGET_DEFAULT (TARGET_ENDIAN_DEFAULT) -#define SUBTARGET_CPU_DEFAULT TARGET_CPU_arm6 - #define SUBTARGET_EXTRA_LINK_SPEC " -m " TARGET_LINKER_EMULATION " -p" /* We do not have any MULTILIB_OPTIONS specified, so there are no diff --git a/gcc/config/arm/symbian.h b/gcc/config/arm/symbian.h index fc9c350cd08..af078d57a2c 100644 --- a/gcc/config/arm/symbian.h +++ b/gcc/config/arm/symbian.h @@ -59,12 +59,6 @@ /* Support the "dllimport" attribute. */ #define TARGET_DLLIMPORT_DECL_ATTRIBUTES 1 -/* Symbian OS assumes ARM V5 or above. Since -march=armv5 is - equivalent to making the ARM 10TDMI core the default, we can set - SUBTARGET_CPU_DEFAULT and get an equivalent effect. */ -#undef SUBTARGET_CPU_DEFAULT -#define SUBTARGET_CPU_DEFAULT TARGET_CPU_arm10tdmi - /* The assembler should assume VFP FPU format, and armv5t. */ #undef SUBTARGET_ASM_FLOAT_SPEC #define SUBTARGET_ASM_FLOAT_SPEC \ diff --git a/gcc/config/arm/unknown-elf.h b/gcc/config/arm/unknown-elf.h index fafe0574ee1..e5c050785a6 100644 --- a/gcc/config/arm/unknown-elf.h +++ b/gcc/config/arm/unknown-elf.h @@ -88,10 +88,6 @@ } \ while (0) -#ifndef SUBTARGET_CPU_DEFAULT -#define SUBTARGET_CPU_DEFAULT TARGET_CPU_arm7tdmi -#endif - /* The libgcc udivmod functions may throw exceptions. If newlib is configured to support long longs in I/O, then printf will depend on udivmoddi4, which will depend on the exception unwind routines,