miscompile: miscompile rv64: addi,andi,beqz,fabs.d,fadd.d,fcvt.d.l
| Run: | explore-db12fc36f6-20261127-115111 |
| Kind: | miscompile |
| Category: | miscompile rv64: addi,andi,beqz,fabs.d,fadd.d,fcvt.d.l M |
| Occurrences: | 1 in 1 configs, 1 test files |
| Snippet from: | double-round-conv.95f4c3b8.5421abc9.ee3b24cd8f.ll (mutant of double-round-conv.95f4c3b8.5421abc9.ll) @test_trunc_si8 via llvm-extract |
| Config: | -mtriple=riscv64 -verify-machineinstrs -target-abi=lp64d -mattr=+d,+v -O0 |
| Local check: | reproduces at db12fc36f6 |
| Compiler Explorer: | not applicable: Compiler Explorer compiles RISC-V but cannot run it |
Snippet:
@G = external global double
@G.4 = external global i8
@G.5 = external global i1
@G.6 = external global float
define signext i8 @test_trunc_si8(double %x) {
%LGV2 = load float, ptr @G.6, align 4
%C3 = fcmp uge float +qnan, %LGV2
%A = alloca bfloat, align 2
store bfloat poison, ptr %A, align 2
%LGV = load i8, ptr @G.4, align 1
%a = call double @llvm.trunc.f64(double %x)
%B = fadd double %x, 4.200000e+01
%b = fptosi double %a to i8
%B1 = fdiv double %x, %B
%C = icmp sge i8 %b, %LGV
store double %B, ptr @G, align 8
%B2 = frem bfloat 3.389530e+38, 4.200000e+01
store i1 %C, ptr @G.5, align 1
store bfloat %B2, ptr %A, align 2
store double %B1, ptr @G, align 8
store i1 %C3, ptr @G.5, align 1
ret i8 %b
}
; Function Attrs: nocallback nocreateundeforpoison nofree nosync nounwind speculatable willreturn memory(none)
declare double @llvm.trunc.f64(double) #0
attributes #0 = { nocallback nocreateundeforpoison nofree nosync nounwind speculatable willreturn memory(none) }
Reproduce:
./exec_oracle.py --flags '-mtriple=riscv64 -verify-machineinstrs -target-abi=lp64d -mattr=+d,+v -O0' --funcs test_trunc_si8 snippet.ll
Local execution result:
3 of 64 inputs differ (first: #12)
SelectionDAG hash a0c2d26326127464, GlobalISel hash 5289e0e02a921a1b
b0: llc -mtriple=riscv64 -verify-machineinstrs -target-abi=lp64d -mattr=+d,+v -O0 -global-isel=0
b1: llc -mtriple=riscv64 -verify-machineinstrs -target-abi=lp64d -mattr=+d,+v -O2 -global-isel=0
b2: llc -mtriple=riscv64 -verify-machineinstrs -target-abi=lp64d -mattr=+d,+v -O0 -global-isel -global-isel-abort=2
Occurrences (1):
| Input | Function | Config |
|---|
| double-round-conv.95f4c3b8.5421abc9.ee3b24cd8f.ll (mutant of double-round-conv.95f4c3b8.5421abc9.ll) | test_trunc_si8 | -mtriple=riscv64 -verify-machineinstrs -target-abi=lp64d -mattr=+d,+v -O0 |
Generated 2026-11-29 14:49 UTC.