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

            Bug ID: 119475
           Summary: RISC-V: After enabling LTO with RVV, compilation
                    errors occur.
           Product: gcc
           Version: 14.2.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
          Assignee: unassigned at gcc dot gnu.org
          Reporter: bigmagicreadsun at gmail dot com
  Target Milestone: ---

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

Details of the Issue

Toolchain Versions:

Prebuilt riscv-gnu-toolchain (riscv-gnu-toolchain releases 2025.01.20-nightly).
Self-compiled GCC 15 (same error occurs).

riscv32-unknown-elf-gcc -O0 -flto -march=rv32imafc_zve32f -mabi=ilp32f
-nostartfiles test.c
  • [Bug c/119475] New: RISC-V: ... bigmagicreadsun at gmail dot com via Gcc-bugs

Reply via email to