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

            Bug ID: 96479
           Summary: AArch64: return SIMD register with -mgeneral-regs-only
           Product: gcc
           Version: 11.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: target
          Assignee: unassigned at gcc dot gnu.org
          Reporter: qiaopeixin at huawei dot com
  Target Milestone: ---

Created attachment 49001
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=49001&action=edit
aarch64: vector incompatible with -mgeneral-regs-only

Hi,

When compiling the test case of vector extraction and insertion with
-mgeneral-regs-only option, which is
gcc/testsuite/c-c++-common/torture/vector-subscript-2.c, GCC reports the ice,
which should not be. It uses the vector with the length of four integers, which
is defined in test case. The start funciton of expand pass will figure out the
mode of eventual return register to store the vector. At this time, GCC will
check if it can be returned in simd/fp register(s), and return v4si register.
Unfortunately, -mgeneral-regs-only prevent the use of simd/fp register(s).

I proposed to add one if statement when entering into the if statement of
checking that the mode of return register is simd/fp. If TARGET_FLOAT is false,
which is enabled by -mgeneral-regs-only option, it will report the error that
'-mgeneral-regs-only' is incompatiable with the use of vector types.

Is it the solution to solve the problem?

All the best

Reply via email to