Skip to content

[RISCV] Miscompile caused by #126108 (Decompose single source shuffles (without exact VLEN)) #126943

@asb

Description

@asb

There's active discussion on #126108, so this issue is written with some haste to provide a clear reproducer an doesn't have in-depth analysis and hasn't further reduced the input.

The issue was initially spotted for RVA23 with EVL tail folding, but can be reproduced just with v:

wget https://raw.githubusercontent.com/llvm/llvm-test-suite/refs/heads/main/SingleSource/Regression/C/gcc-c-torture/execute/20050826-2.c
$HOME/llvm-project/build/stage1/bin/clang  \
  --target=riscv64-linux-gnu \
  -fuse-ld=lld \
  --sysroot=$HOME/rvsysroot \
  -O3 \
  -march=rva20u64_v \
  20050826-2.c
export QEMU_LD_PREFIX="$HOME/rvsysroot"
./a.out # program aborts

(rvsysroot should work with any sysroot with the minimal files for linking and loading a working executable). The above assumes you have a working qemu-riscv64 that executes via binfmt_misc.

Metadata

Metadata

Assignees

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions