riscv-gnu-toolchain icon indicating copy to clipboard operation
riscv-gnu-toolchain copied to clipboard

[2025.02]After enabling LTO with RVV, compilation errors occur

Open bigmagic123 opened this issue 3 months ago • 0 comments

When compiling the following code using RISC-V RVV extensions with LTO enabled:

#include <riscv_vector.h>
#include <stdio.h>
typedef float float32_t;
int rvv_cfft_f32(void) {
    size_t avl = 5;
    const float32_t *px;
    size_t vl = __riscv_vsetvl_e32m2(avl);
    vfloat32m2x2_t v_tuple = __riscv_vlseg2e32_v_f32m2x2(px, vl);
    vfloat32m2_t va_im = __riscv_vget_v_f32m2x2_f32m2(v_tuple, 1);
    va_im = __riscv_vfneg_v_f32m2(va_im, vl);
}

The compilation fails with the following error:

lto1: fatal error: target specific builtin not available
compilation terminated.
lto-wrapper: fatal error: riscv32-unknown-elf-gcc returned 1 exit status
compilation terminated.
/home/riscv/bin/../lib/gcc/riscv32-unknown-elf/14.2.0/../../../../riscv32-unknown-elf/bin/ld: error: lto-wrapper failed
collect2: error: ld returned 1 exit status

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

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

bigmagic123 avatar Aug 18 '25 09:08 bigmagic123