Issue 136564
Summary [RISCV] `clang` mistakenly permits `Zilsd` extension for `rv64`
Labels clang
Assignees
Reporter thebigclub
    The`Zilsd` and `Zclsd` [extensions](https://github.com/riscv/riscv-isa-manual/blob/main/src/zilsd.adoc) provide a way for `rv32` architectures to use doubleword loads and stores. The extensions exist for `rv32` only and not `rv64`. `clang` currently permits `Zilsd` for `rv64`:

```bash
$ echo "int main(void){}" > test.c
$ clang -march=rv64i_zilsd -c test.c
$ echo $?
0
$ clang -march=rv64i_zclsd -c test.c
clang: error: invalid arch name 'rv64i_zclsd', 'zclsd' is only supported for 'rv32'
$ echo $?
1
$ clang -v
clang version 21.0.0git (https://github.com/llvm/llvm-project.git 4aca20c8b6dcf86696db03d860e635112601a7f9)
Target: riscv32-unknown-unknown-elf
```

`clang`'s behavior for `Zilsd` should match `Zclsd` when targeting `rv64`.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to