@@ -535,6 +535,13 @@ handle_arm_mve_h (bool preserve_user_namespace)
return;
}
+ if (!handle_arm_mve_types_p)
+ {
+ error ("this definition requires MVE types, please include %qs",
+ "arm_mve_types.h");
+ return;
+ }
+
/* Define MVE functions. */
function_table = new hash_table<registered_function_hasher> (1023);
function_builder builder;
new file mode 100644
@@ -0,0 +1,7 @@
+/* { dg-do compile } */
+/* { dg-require-effective-target arm_v8_1m_mve_ok } */
+/* { dg-add-options arm_v8_1m_mve } */
+
+/* It doesn't really matter if this produces errors missing types,
+ but it mustn't trigger an ICE. */
+#pragma GCC arm "arm_mve.h" false /* { dg-error "this definition requires MVE types, please include 'arm_mve_types.h'" } */
new file mode 100644
@@ -0,0 +1,7 @@
+/* { dg-do compile } */
+/* { dg-require-effective-target arm_v8_1m_mve_ok } */
+/* { dg-add-options arm_v8_1m_mve } */
+
+/* It doesn't really matter if this produces errors missing types,
+ but it mustn't trigger an ICE. */
+#pragma GCC arm "arm_mve.h" true /* { dg-error "this definition requires MVE types, please include 'arm_mve_types.h'" } */
Changes since v1: - Updated the error message to mention that arm_mve_types.h needs to be included. - Corrected some spelling errors in commit message. As the warning for pure functions returning void is not related to this patch, I'll leave it for you Christophe to look into. :) Ok for trunk and releases/gcc-14? -- Starting with r14-435-g00d97bf3b5a, doing `#pragma arm "arm_mve.h" false` or `#pragma arm "arm_mve.h" true` without first doing `#pragma arm "arm_mve_types.h"` causes GCC to ICE. gcc/ChangeLog: PR target/117408 * config/arm/arm-mve-builtins.cc(handle_arm_mve_h): Detect if MVE types are missing and if so, return error. gcc/testsuite/ChangeLog: PR target/117408 * gcc.target/arm/mve/pr117408-1.c: New test. * gcc.target/arm/mve/pr117408-2.c: Likewise. Signed-off-by: Torbjörn SVENSSON <torbjorn.svensson@foss.st.com> --- gcc/config/arm/arm-mve-builtins.cc | 7 +++++++ gcc/testsuite/gcc.target/arm/mve/pr117408-1.c | 7 +++++++ gcc/testsuite/gcc.target/arm/mve/pr117408-2.c | 7 +++++++ 3 files changed, 21 insertions(+) create mode 100644 gcc/testsuite/gcc.target/arm/mve/pr117408-1.c create mode 100644 gcc/testsuite/gcc.target/arm/mve/pr117408-2.c