@@ -535,6 +535,12 @@ handle_arm_mve_h (bool preserve_user_namespace)
return;
}
+ if (!handle_arm_mve_types_p)
+ {
+ error ("this definition requires MVE types")
+ 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" } */
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" } */
There is one more problem, that this patch does not address, and that is that there are warnings like below, but I do not know what's causing them. .../gcc/testsuite/gcc.target/arm/pr117408-1.c:8:9: warning: 'pure' attribute on function returning 'void' [-Wattributes] .../gcc/testsuite/gcc.target/arm/pr117408-2.c:8:9: warning: 'pure' attribute on function returning 'void' [-Wattributes] Both warnignss are repeted several times and generated by the #pragma-line. Should I dg-prune-output warning lines or is this ok as-is 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 is 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 | 6 ++++++ gcc/testsuite/gcc.target/arm/mve/pr117408-1.c | 7 +++++++ gcc/testsuite/gcc.target/arm/mve/pr117408-2.c | 7 +++++++ 3 files changed, 20 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