miscompile: miscompile rv64: li,lui,mul,sb,sh,snez
| Run: | explore-db12fc36f6-20261127-115111 |
| Kind: | miscompile |
| Category: | miscompile rv64: li,lui,mul,sb,sh,snez M |
| Occurrences: | 1 in 1 configs, 1 test files |
| Snippet from: | memset-inline.a738fe63.8d983472.6d5f7d77aa.ll (mutant of memset-inline.a738fe63.8d983472.ll) @aligned_memset_zero_2 via llvm-extract |
| Config: | -mtriple=riscv64 -verify-machineinstrs -mattr=+m,+v,+unaligned-scalar-mem,+unaligned-vector-mem,+f,+c,+zvkb,+zfhmin -O1 -code-model=small |
| Local check: | reproduces at db12fc36f6 |
| Compiler Explorer: | not applicable: Compiler Explorer compiles RISC-V but cannot run it |
Snippet:
@G.1 = external global i8
@G.4 = external global i1
@G.5 = external global i8
; Function Attrs: nounwind
define void @aligned_memset_zero_2(ptr %a) #0 {
%LGV = load i8, ptr @G.5, align 1
%E = extractelement <8 x i8> splat (i8 -1), i8 -1
tail call void @llvm.memset.inline.p0.i64(ptr align 2 %a, i8 %E, i64 2, i1 false)
%C = icmp ule i8 %E, 0
store i1 %C, ptr @G.4, align 1
%B = sub i8 %E, %LGV
store i8 %B, ptr @G.1, align 1
ret void
}
; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: write)
declare void @llvm.memset.inline.p0.i64(ptr writeonly captures(none), i8, i64, i1 immarg) #1
attributes #0 = { nounwind }
attributes #1 = { nocallback nofree nosync nounwind willreturn memory(argmem: write) }
Reproduce:
./exec_oracle.py --flags '-mtriple=riscv64 -verify-machineinstrs -mattr=+m,+v,+unaligned-scalar-mem,+unaligned-vector-mem,+f,+c,+zvkb,+zfhmin -O1 -code-model=small' --funcs aligned_memset_zero_2 snippet.ll
Local execution result:
64 of 64 inputs differ (first: #0)
SelectionDAG hash cb02b1a8778bd05f, GlobalISel hash f49f388c7c8010a7
b0: llc -mtriple=riscv64 -verify-machineinstrs -mattr=+m,+v,+unaligned-scalar-mem,+unaligned-vector-mem,+f,+c,+zvkb,+zfhmin -code-model=small -O1 -global-isel=0
b1: llc -mtriple=riscv64 -verify-machineinstrs -mattr=+m,+v,+unaligned-scalar-mem,+unaligned-vector-mem,+f,+c,+zvkb,+zfhmin -code-model=small -O0 -global-isel=0
b2: llc -mtriple=riscv64 -verify-machineinstrs -mattr=+m,+v,+unaligned-scalar-mem,+unaligned-vector-mem,+f,+c,+zvkb,+zfhmin -code-model=small -O1 -global-isel -global-isel-abort=2
Occurrences (1):
| Input | Function | Config |
|---|
| memset-inline.a738fe63.8d983472.6d5f7d77aa.ll (mutant of memset-inline.a738fe63.8d983472.ll) | aligned_memset_zero_2 | -mtriple=riscv64 -verify-machineinstrs -mattr=+m,+v,+unaligned-scalar-mem,+unaligned-vector-mem,+f,+c,+zvkb,+zfhmin -O1 -code-model=small |
Generated 2026-11-29 14:49 UTC.