diff --git a/gcc/config/aarch64/aarch64-builtins.cc b/gcc/config/aarch64/aarch64-builtins.cc index 5bb873c3923..611f6dc45e0 100644 --- a/gcc/config/aarch64/aarch64-builtins.cc +++ b/gcc/config/aarch64/aarch64-builtins.cc @@ -2321,6 +2321,7 @@ aarch64_init_ls64_builtins_types (void) const char *tuple_type_name = "__arm_data512_t"; tree node_type = get_typenode_from_name (UINT64_TYPE); tree array_type = build_array_type_nelts (node_type, 8); + array_type = build_distinct_type_copy (array_type); SET_TYPE_MODE (array_type, V8DImode); gcc_assert (TYPE_MODE_RAW (array_type) == TYPE_MODE (array_type)); diff --git a/gcc/testsuite/g++.target/aarch64/pr124126-1.C b/gcc/testsuite/g++.target/aarch64/pr124126-1.C new file mode 100644 index 00000000000..ffe4fb6690b --- /dev/null +++ b/gcc/testsuite/g++.target/aarch64/pr124126-1.C @@ -0,0 +1,15 @@ +/* { dg-do compile } */ +/* { dg-additional-options "-g" } */ +/* PR target/124126 */ +/* Make sure an array of uint64_t[8] works when + used before the inlcude of arm_acle.h. */ + +typedef unsigned long uint64_t; +void executeSuperscalar(uint64_t (*r)[8]); + +#include "arm_acle.h" + +void initDatasetItem() { + uint64_t rl[8]; + executeSuperscalar(&rl); +}