Hi Robin, I reduced the SZ size from 10 to 1, and the below case with SZ = 2 will fail. The failed location is "foo is 50, foo2 is 12800, i,j is 1, 0".
#define SZ 2 const char *s[SZ] = {"1", "12345678901234567889012345678901234567890"}; Executing on host: /home/pli/gcc/111/riscv-gnu-toolchain/build-gcc-newlib-stage2/gcc/xgcc -B/home/pli/gcc/111/riscv-gnu-toolchain/build-gcc-newlib-stage2/gcc/ exceptions_enabled4031601.cc -march=rv64gcv_zvl512b -mabi=lp64d -mcmodel=medlow --param=riscv-autovec-lmul=m4 -fdiagnostics-plain-output -Wno-complain-wrong-lang -S -o exceptions_enabled4031601.s (timeout = 600) spawn -ignore SIGHUP /home/pli/gcc/111/riscv-gnu-toolchain/build-gcc-newlib-stage2/gcc/xgcc -B/home/pli/gcc/111/riscv-gnu-toolchain/build-gcc-newlib-stage2/gcc/ exceptions_enabled4031601.cc -march=rv64gcv_zvl512b -mabi=lp64d -mcmodel=medlow --param=riscv-autovec-lmul=m4 -fdiagnostics-plain-output -Wno-complain-wrong-lang -S -o exceptions_enabled4031601.s PASS: gcc.target/riscv/rvv/autovec/builtin/strcmp-run.c (test for excess errors) spawn riscv64-unknown-elf-run ./strcmp-run.exe + QEMU_CPU=rv64,vlen=512,v=true,vext_spec=v1.0,Zve32f=true,Zve64f=true + qemu-riscv64 -r 5.10 -L /home/pli/gcc/111/riscv-gnu-toolchain/__RISC-V_INSTALL___/sysroot ./strcmp-run.exe qemu-riscv64: warning: CPU property 'Zve32f' is deprecated. Please use 'zve32f' instead qemu-riscv64: warning: CPU property 'Zve64f' is deprecated. Please use 'zve64f' instead foo is 50, foo2 is 12800, i,j is 1, 0 FAIL: gcc.target/riscv/rvv/autovec/builtin/strcmp-run.c execution test Pan -----Original Message----- From: Robin Dapp <rdapp....@gmail.com> Sent: Monday, December 11, 2023 4:34 PM To: Li, Pan2 <pan2...@intel.com>; 钟居哲 <juzhe.zh...@rivai.ai>; gcc-patches <gcc-patches@gcc.gnu.org>; palmer <pal...@dabbelt.com>; kito.cheng <kito.ch...@gmail.com>; Jeff Law <jeffreya...@gmail.com> Cc: rdapp....@gmail.com Subject: Re: [PATCH] RISC-V: Add vectorized strcmp. > FYI. I have the some failures as juzhe mentioned, with the emulator > qemu version qemu-riscv64 version 8.1.93 (v8.2.0-rc3). The entire log > may look like below: > > Executing on host: > /home/box/panli/riscv-gnu-toolchain/build-gcc-newlib-stage2/gcc/xgcc > -B/home/box/panli/riscv-gnu-toolchain/build-gcc-newlib-stage2/gcc/ > /home/box/panli/riscv-gnu-toolchain/gcc/gcc/testsuite/gcc.target/riscv/rvv/autovec/builtin/strcmp-run.c > -march=rv64gcv -mabi=lp64d -mcmodel=medlow --param=riscv-autovec-lmul=m1 > --param=riscv-autovec-preference=fixed-vlmax -fdiagnostics-plain-output > -ftree-vectorize -O3 --param riscv-autovec-lmul=m1 -O3 -minline-strcmp > -lm -o ./strcmp-run.exe (timeout = 600) > > spawn -ignore SIGHUP > /home/box/panli/riscv-gnu-toolchain/build-gcc-newlib-stage2/gcc/xgcc > -B/home/box/panli/riscv-gnu-toolchain/build-gcc-newlib-stage2/gcc/ > /home/box/panli/riscv-gnu-toolchain/gcc/gcc/testsuite/gcc.target/riscv/rvv/autovec/builtin/strcmp-run.c > -march=rv64gcv -mabi=lp64d -mcmodel=medlow --param=riscv-autovec-lmul=m1 > --param=riscv-autovec-preference=fixed-vlmax -fdiagnostics-plain-output > -ftree-vectorize -O3 --param riscv-autovec-lmul=m1 -O3 -minline-strcmp -lm -o > ./strcmp-run.exe^M Thanks, it must be a bug if you both see it. But I cannot reproduce it yet for some reason. I tried your exact parameters (just didn't use newlib). Also, for Juzhe it seemed to fail without -minline-strcmp for you it fails with it. Maybe my testcase uses undefined behavior? Could you try reducing SZ to 1 for a test? Regards Robin