https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95105

            Bug ID: 95105
           Summary: Bogus reference-compatibility error for
                    arm_sve_vector_bits
           Product: gcc
           Version: 10.1.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: target
          Assignee: unassigned at gcc dot gnu.org
          Reporter: rsandifo at gcc dot gnu.org
  Target Milestone: ---
            Target: aarch64*-*-*

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;
----------------------------------------------------------

gives the bogus error:

error: cannot bind non-const lvalue reference of type ‘bar&’ {aka
‘__SVFloat32_t&’} to an rvalue of type ‘bar’ {aka ‘__SVFloat32_t’}
    5 | bar &b = a.x;
      |          ~~^

The testcase works if the attribute is applied directly
to __SVFloat32_t.

The bug is in the target-specific handling of the attribute.

Reply via email to