miscompile: miscompile rv64: addi,beq,bne,fcvt.l.s,fcvt.w.s,ld

Run:explore-b577f07195-20261129-105236
Kind:miscompile
Category:miscompile rv64: addi,beq,bne,fcvt.l.s,fcvt.w.s,ld NEW M
Occurrences:1 in 1 configs, 1 test files
Snippet from:float-convert.f546d155.8d2b86c25a.ll (mutant of float-convert.f546d155.ll) @fcvt_w_s_i16 via llvm-extract
Config:-mtriple=riscv64 -verify-machineinstrs -target-abi=lp64f -mattr=+f,+zvfh -O2
Local check:reproduces at b577f07195
Compiler Explorer:not applicable: Compiler Explorer compiles RISC-V but cannot run it

Snippet:

@G.6 = external global i16

; Function Attrs: nounwind
define signext i16 @fcvt_w_s_i16(float %a) #0 {
  %A1 = alloca i64, align 8
  store i64 42, ptr %A1, align 4
  %C = icmp slt i64 1, 1
  %A = alloca i16, align 2
  %L = load i64, ptr %A, align 4
  store i16 poison, ptr %A, align 2
  %1 = fptosi float %a to i16
  %L2 = load i64, ptr %A1, align 4
  switch i64 %L2, label %SW_D [
    i64 7947181626026473461, label %SW_C
    i64 1840041873922676645, label %SW_C3
    i64 -4200355665586619570, label %SW_C4
    i64 3117855586734163887, label %SW_C5
  ]

BB:                                               ; preds = %SW_C3, %SW_D
  %B = xor i16 %1, %1
  store i16 %B, ptr %A, align 2
  store i1 %C, ptr %A, align 1
  ret i16 %1

SW_D:                                             ; preds = %0
  br label %BB

SW_C:                                             ; preds = %0
  %LGV = load i16, ptr @G.6, align 2
  ret i16 %LGV

SW_C3:                                            ; preds = %0
  br label %BB

SW_C4:                                            ; preds = %0
  ret i16 %1

SW_C5:                                            ; preds = %0
  %LGV6 = load i16, ptr @G.6, align 2
  ret i16 1
}

attributes #0 = { nounwind }

Reproduce:

./exec_oracle.py --flags '-mtriple=riscv64 -verify-machineinstrs -target-abi=lp64f -mattr=+f,+zvfh -O2' --funcs fcvt_w_s_i16 snippet.ll

Local execution result:

3 of 64 inputs differ (first: #12)
SelectionDAG hash 35a83a8c39022ab9, GlobalISel hash 4a0c640c306e95b7
b0: llc -mtriple=riscv64 -verify-machineinstrs -target-abi=lp64f -mattr=+f,+zvfh -O2 -global-isel=0
b1: llc -mtriple=riscv64 -verify-machineinstrs -target-abi=lp64f -mattr=+f,+zvfh -O0 -global-isel=0
b2: llc -mtriple=riscv64 -verify-machineinstrs -target-abi=lp64f -mattr=+f,+zvfh -O2 -global-isel -global-isel-abort=2

Occurrences (1):

InputFunctionConfig
float-convert.f546d155.8d2b86c25a.ll (mutant of float-convert.f546d155.ll)fcvt_w_s_i16-mtriple=riscv64 -verify-machineinstrs -target-abi=lp64f -mattr=+f,+zvfh -O2

Generated 2026-11-29 14:49 UTC.