https://gcc.gnu.org/g:42b24557bdf805d2913d3c75531fe441b1634332

commit r15-6682-g42b24557bdf805d2913d3c75531fe441b1634332
Author: Christophe Lyon <christophe.l...@linaro.org>
Date:   Tue Jan 7 16:59:03 2025 +0000

    arm: [MVE intrinsics] Fix tuples field name (PR 118332)
    
    A recent commit mistakenly changed the field name for tuples from
    'val' to '__val', but unlike SVE this name is mandated by ACLE.
    
    The patch simply switches back the name to 'val'.
    
            PR target/118332
    
    gcc/ChangeLog:
    
            * config/arm/arm-mve-builtins.cc (wrap_type_in_struct): Use 'val'
            instead of '__val'.
    
    gcc/testsuite/ChangeLog:
    
            * gcc.target/arm/mve/intrinsics/pr118332.c: New test.

Diff:
---
 gcc/config/arm/arm-mve-builtins.cc                     | 5 ++---
 gcc/testsuite/gcc.target/arm/mve/intrinsics/pr118332.c | 5 +++++
 2 files changed, 7 insertions(+), 3 deletions(-)

diff --git a/gcc/config/arm/arm-mve-builtins.cc 
b/gcc/config/arm/arm-mve-builtins.cc
index aacdbf159b97..4c52415f3f1b 100644
--- a/gcc/config/arm/arm-mve-builtins.cc
+++ b/gcc/config/arm/arm-mve-builtins.cc
@@ -464,13 +464,12 @@ register_vector_type (vector_type_index type)
 }
 
 /* Return a structure type that contains a single field of type FIELD_TYPE.
-   The field is called __val, but that's an internal detail rather than
-   an exposed part of the API.  */
+   The field is called 'val', as mandated by ACLE.  */
 static tree
 wrap_type_in_struct (tree field_type)
 {
   tree field = build_decl (input_location, FIELD_DECL,
-                          get_identifier ("__val"), field_type);
+                          get_identifier ("val"), field_type);
   tree struct_type = lang_hooks.types.make_type (RECORD_TYPE);
   DECL_FIELD_CONTEXT (field) = struct_type;
   TYPE_FIELDS (struct_type) = field;
diff --git a/gcc/testsuite/gcc.target/arm/mve/intrinsics/pr118332.c 
b/gcc/testsuite/gcc.target/arm/mve/intrinsics/pr118332.c
new file mode 100644
index 000000000000..a8f6389c58d5
--- /dev/null
+++ b/gcc/testsuite/gcc.target/arm/mve/intrinsics/pr118332.c
@@ -0,0 +1,5 @@
+/* { dg-require-effective-target arm_v8_1m_mve_ok } */
+/* { dg-add-options arm_v8_1m_mve } */
+
+#include <arm_mve.h>
+uint32x4_t first(uint32x4x4_t a) { return a.val[0]; }

Reply via email to