This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[PATCH][ARM] Error out of arm_neon.h if compiling for soft-float ABI
- From: Kyrill Tkachov <kyrylo dot tkachov at foss dot arm dot com>
- To: GCC Patches <gcc-patches at gcc dot gnu dot org>
- Cc: Ramana Radhakrishnan <ramana dot radhakrishnan at arm dot com>, Richard Earnshaw <Richard dot Earnshaw at arm dot com>
- Date: Mon, 29 Feb 2016 17:48:44 +0000
- Subject: [PATCH][ARM] Error out of arm_neon.h if compiling for soft-float ABI
- Authentication-results: sourceware.org; auth=none
Hi all,
Now that we've moved to pragmas guarding the various intrinsics in arm_neon.h I think we should still
throw a #error if someone tries to include the header while compiling for -mfloat-abi=soft.
This gives a more helpful error message when someone has a compiler configured --with-float=soft
and forgets to add an appropriate -mfloat-abi option on the command line.
Currently we'll just give tons of error messages whereas with this patch we just
show a simple clean message.
Tested on arm. This could be argued to be a user experience regression fix.
Ok for trunk?
Thanks,
Kyrill
2016-02-29 Kyrylo Tkachov <kyrylo.tkachov@arm.com>
* config/arm/arm_neon.h: Show error if using with soft-float ABI.
diff --git a/gcc/config/arm/arm_neon.h b/gcc/config/arm/arm_neon.h
index 47816d52187b979b92d7592991d29e4cbe8f9357..6a880235d24759e9938fb08365eaddff77d60f0e 100644
--- a/gcc/config/arm/arm_neon.h
+++ b/gcc/config/arm/arm_neon.h
@@ -27,6 +27,10 @@
#ifndef _GCC_ARM_NEON_H
#define _GCC_ARM_NEON_H 1
+#ifndef __ARM_FP
+#error "NEON intrinsics not available with the soft-float ABI. Please use -mfloat-abi=softp or -mfloat-abi=hard"
+#else
+
#pragma GCC push_options
#pragma GCC target ("fpu=neon")
@@ -14833,3 +14837,4 @@ vmull_high_p64 (poly64x2_t __a, poly64x2_t __b)
#pragma GCC pop_options
#endif
+#endif