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

            Bug ID: 111935
           Summary: gcc ICE with risc-v vector intrinsics
           Product: gcc
           Version: 13.2.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
          Assignee: unassigned at gcc dot gnu.org
          Reporter: julienpommier at free dot fr
  Target Milestone: ---

The following code (test.c) crashes the riscv gcc 13.2.0 compiler of ubuntu
23.10:

#include <riscv_vector.h>

inline vuint32m4_t __attribute__((__always_inline__)) transpose_indexes() {
  static const uint32_t idx_[16] = {0, 4, 8, 12,
                      1, 5, 9, 13,
                      2, 6, 10, 14,
                      3, 7, 11, 15};
  return __riscv_vle32_v_u32m4(idx_, 16);
}

void pffft_real_preprocess_4x4(const float *in) {
  vfloat32m1_t r0=__riscv_vle32_v_f32m1(in,4);
  vfloat32m4_t tmp = __riscv_vundefined_f32m4();
  tmp = __riscv_vset_v_f32m1_f32m4(tmp, 0, r0);
  tmp = __riscv_vset_v_f32m1_f32m4(tmp, 1, r0);
  tmp = __riscv_vset_v_f32m1_f32m4(tmp, 2, r0);
  tmp = __riscv_vset_v_f32m1_f32m4(tmp, 3, r0);
  tmp = __riscv_vrgather_vv_f32m4(tmp, transpose_indexes(), 16);
  r0 = __riscv_vget_v_f32m4_f32m1(tmp, 0);
}



when compiled with:

riscv64-linux-gnu-gcc-13 -O1 -march=rv64gcv -c testcase.c

the output is:

during RTL pass: expand
test.c: In function ‘pffft_real_preprocess_4x4’:
test.c:19:8: internal compiler error: Segmentation fault
   19 |   r0 = __riscv_vget_v_f32m4_f32m1(tmp, 0);
      |        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
0xffffae3a7583 __libc_start_call_main
        ../sysdeps/nptl/libc_start_call_main.h:58
0xffffae3a7657 __libc_start_main_impl
        ../csu/libc-start.c:360
Please submit a full bug report, with preprocessed source (by using
-freport-bug).
Please include the complete backtrace with any bug report.
See <file:///usr/share/doc/gcc-13/README.Bugs> for instructions.

Reply via email to