I see, I can reproduce this when build "-march=rv64gcv -mabi=lp64d -flto -O0 
test.c -o test.elf".

#include <riscv_vector.h>

int
main ()
{
  size_t vl = 8;
  vint32m1_t vs1 = {};
  vint32m1_t vs2 = {};
  vint32m1_t vd = __riscv_vadd_vv_i32m1(vs1, vs2, vl);

  return (int)&vd;
}

Pan

-----Original Message-----
From: Jin Ma <ji...@linux.alibaba.com> 
Sent: Sunday, September 8, 2024 1:15 PM
To: Li, Pan2 <pan2...@intel.com>; gcc-patches@gcc.gnu.org
Cc: jeffreya...@gmail.com; juzhe.zh...@rivai.ai; kito.ch...@gmail.com; 
jinma.cont...@gmail.com
Subject: Re: [PATCH] RISC-V: Fix ICE for rvv in lto

> > #include <riscv_vector.h>
> > 
> > vint32m1_t foo(vint32m1_t vs1, vint32m1_t vs2, size_t vl) 
> > {
> >   return __riscv_vadd_vv_i32m1(vs1, vs2, vl);
> > }
> 
> To double confirm, you mean "riscv64-linux-gnu-gcc-14 -march=rv64gcv 
> -mabi=lp64d -flto -O0 tmp.c -c -S -o -" with above is able to reproduce this 
> ICE?
> 
> Pan

Not too accurate, please don't add "-S" or "-c", let the compilation go to the 
linker and try to generate the binary.
The normal result of compilation should be to throw an error that the main 
function cannot be found, but unfortunately
ICE appears.

By the way, The gcc-14 in my environment is built on releases/gcc-14, I didn't 
download any compiled gcc.

Of course, it is also possible that my local environment is broken, and I will 
check it again.

BR
Jin

Reply via email to