This is the mail archive of the mailing list for the GCC project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [arm] Fix incorrect __ARM_ARCH_PROFILE for -march=armv7

On 28/06/17 16:05, Richard Earnshaw (lists) wrote:
> ACLE explicitly states that when targetting the common subset of
> ARMv7-A, ARMv7-R and ARMv7-M, the __ARM_ARCH_PROFILE macro should not be
> set.  We currently set it to 'M' which is clearly erroneous.
> The logic for creating this is very convoluted and also somewhat
> fragile, so I've taken the opportunity to use the new CPU and
> architecture definition infrastructure to record the profile for each
> architecture explicitly rather than try to reconstruct it from other
> data.  I think this results in a much more robust solution.
> 2017-06-28  Richard Earnshaw  <>
> 	* config/arm/parsecpu.awk (profile): Parse new keyword in an arch
> 	context.
> 	(gen_comm_data): Emit architectural setting of arch_prof.
> 	* config/arm/ (armv6-m, armv6s-m, armv7-a, armv7ve): Set the
> 	profile.
> 	(armv7-r, armv7-m, armv7e-m, armv8-a, armv8.1-a, armv8.2-a): Likewise.
> 	(armv8-m.base, armv8-m.main): Likewise.
> 	* arm-protos.h (arm_build_target): Add profile field.
> 	(arch_option): Likewise.
> 	* config/arm/arm.c (arm_configure_build_target): Copy the profile to
> 	the active target.
> 	* config/arm/arm.h (TARGET_ARM_ARCH_PROFILE): Use
> 	arm_active_target.profile.
> Committed.

My patch yesterday accidentally missed a hunk that added the
update to the tail entry of the autogenerated data structure
produced by parsecpu.awk.  This causes native bootstraps to

This patch adds back the missing hunk.

2017-06-29  Richard Earnshaw  <>

	* config/arm/parsecpu.awk (gen_comm_data): Add initializer for
	profile to the dummy entry at the end of the list of architectures.
	* config/arm/arm-cpu-cdata.h: Regenerated.
diff --git a/gcc/config/arm/arm-cpu-cdata.h b/gcc/config/arm/arm-cpu-cdata.h
index 4528d07..1cf1149 100644
--- a/gcc/config/arm/arm-cpu-cdata.h
+++ b/gcc/config/arm/arm-cpu-cdata.h
@@ -2462,7 +2462,7 @@ const arch_option all_architectures[] =
   {{NULL, NULL, {isa_nobit}},
-   NULL, BASE_ARCH_0, TARGET_CPU_arm_none}
+   NULL, BASE_ARCH_0, 0, TARGET_CPU_arm_none}
 const arm_fpu_desc all_fpus[] =
diff --git a/gcc/config/arm/parsecpu.awk b/gcc/config/arm/parsecpu.awk
index d38d664..d096bca 100644
--- a/gcc/config/arm/parsecpu.awk
+++ b/gcc/config/arm/parsecpu.awk
@@ -311,7 +311,7 @@ function gen_comm_data () {
     print "  {{NULL, NULL, {isa_nobit}},"
-    print "   NULL, BASE_ARCH_0, TARGET_CPU_arm_none}"
+    print "   NULL, BASE_ARCH_0, 0, TARGET_CPU_arm_none}"
     print "};\n"
     print "const arm_fpu_desc all_fpus[] ="

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]