aboutsummaryrefslogtreecommitdiff
path: root/libgcc
diff options
context:
space:
mode:
authorRichard Sandiford <richard.sandiford@arm.com>2020-05-14 12:20:32 +0100
committerRichard Sandiford <richard.sandiford@arm.com>2020-05-14 12:20:32 +0100
commit2c814af65ef9f146519cba657890a4fd93c5be38 (patch)
tree310ef15bc44395d6c0d8b8e6bb473338ae6074b0 /libgcc
parent0d1ccfd0cc2e1add15929c43e6c7472336d33e65 (diff)
downloadgcc-2c814af65ef9f146519cba657890a4fd93c5be38.zip
gcc-2c814af65ef9f146519cba657890a4fd93c5be38.tar.gz
gcc-2c814af65ef9f146519cba657890a4fd93c5be38.tar.bz2
aarch64: Fix arm_sve_vector_bits on typedefs [PR95105]
Compiling this testcase with -march=armv8.2-a+sve -msve-vector-bits=512: ---------------------------------------------------------- typedef __SVFloat32_t foo; typedef foo bar __attribute__((arm_sve_vector_bits(512))); template<typename T> struct s { T x; }; extern s<bar> a; bar &b = a.x; ---------------------------------------------------------- gave the bogus error: cannot bind non-const lvalue reference of type ‘bar&’ to an rvalue of type ‘bar’ The testcase works if the attribute is applied directly to __SVFloat32_t instead of via foo. This shows a more general problem with the way that we were handling the arm_sve_vector_bits attribute: we started by building a distinct copy of the type to which the attribute was applied, instead of starting with its main variant. This new type then became its own main variant, meaning that the relationship between types that have the attribute could be different from the relationship between types that don't have the attribute. This patch instead copies the main variant of the original type and then reapplies all the differences. 2020-05-14 Richard Sandiford <richard.sandiford@arm.com> gcc/ PR target/95105 * config/aarch64/aarch64-sve-builtins.cc (handle_arm_sve_vector_bits_attribute): Create a copy of the original type's TYPE_MAIN_VARIANT, then reapply all the differences between the original type and its main variant. gcc/testsuite/ PR target/95105 * gcc.target/aarch64/sve/acle/general/attributes_8.c: New test. * g++.target/aarch64/sve/acle/general-c++/attributes_1.C: Likewise.
Diffstat (limited to 'libgcc')
0 files changed, 0 insertions, 0 deletions