miscompile: miscompile rv64: addi,andi,beqz,bnez,fcvt.d.l,fcvt.l.d

Run:explore-db12fc36f6-20261127-115111
Kind:miscompile
Category:miscompile rv64: addi,andi,beqz,bnez,fcvt.d.l,fcvt.l.d NEW M
Occurrences:1 in 1 configs, 1 test files
Snippet from:double-round-conv.95f4c3b8.b9364c85.6e322b4824.ll (mutant of double-round-conv.95f4c3b8.b9364c85.ll) @test_trunc_si8 via llvm-extract
Config:-mtriple=riscv64 -verify-machineinstrs -target-abi=lp64d -mattr=+d,+c -O2
Local check:reproduces at db12fc36f6
Compiler Explorer:not applicable: Compiler Explorer compiles RISC-V but cannot run it

Snippet:

@G = external global double
@G.5 = external global <2 x i64>

define signext i8 @test_trunc_si8(double %x) {
  %A = alloca i1, align 1
  store i1 true, ptr %A, align 1
  %a = call double @llvm.trunc.f64(double %x)
  %L = load i1, ptr %A, align 1
  br i1 %L, label %T, label %F

BB:                                               ; preds = %F, %T
  %B = fadd double %x, 4.200000e+01
  br i1 %L, label %T3, label %F4

BB2:                                              ; preds = %T3
  %b = fptosi double %a to i8
  store double %B, ptr @G, align 8
  ret i8 %b

T:                                                ; preds = %0
  %B1 = add <2 x i64> splat (i64 42), splat (i64 -9223372036854775808)
  store <2 x i64> %B1, ptr @G.5, align 16
  br label %BB

F:                                                ; preds = %0
  br label %BB

T3:                                               ; preds = %BB
  br label %BB2

F4:                                               ; preds = %BB
  ret i8 -128
}

; 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,+c -O2' --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,+c -O2 -global-isel=0
b1: llc -mtriple=riscv64 -verify-machineinstrs -target-abi=lp64d -mattr=+d,+c -O0 -global-isel=0
b2: llc -mtriple=riscv64 -verify-machineinstrs -target-abi=lp64d -mattr=+d,+c -O2 -global-isel -global-isel-abort=2

Occurrences (1):

InputFunctionConfig
double-round-conv.95f4c3b8.b9364c85.6e322b4824.ll (mutant of double-round-conv.95f4c3b8.b9364c85.ll)test_trunc_si8-mtriple=riscv64 -verify-machineinstrs -target-abi=lp64d -mattr=+d,+c -O2

Generated 2026-11-29 14:49 UTC.