miscompile: miscompile rv64: addi,andi,bge,blt,bne,bnez

Run:explore-d9924131a4-20261128-105811
Kind:miscompile
Category:miscompile rv64: addi,andi,bge,blt,bne,bnez NEW M
Occurrences:1 in 1 configs, 1 test files
Snippet from:rv64zfhmin-half-convert.7fc7c14904.ll (mutant of rv64zfhmin-half-convert.ll) @zext_fptoui via llvm-extract
Config:-mtriple=riscv64 -verify-machineinstrs -target-abi lp64f -mattr=+zfhmin,+m -O2
Local check:reproduces at d9924131a4
Compiler Explorer:not applicable: Compiler Explorer compiles RISC-V but cannot run it

Snippet:

@G.1 = external global i32

; Function Attrs: nounwind
define zeroext i32 @zext_fptoui(half %a) #0 {
  %A7 = alloca i1, align 1
  store i1 true, ptr %A7, align 1
  %A = alloca i1, align 1
  store i1 false, ptr %A, align 1
  %LGV = load i32, ptr @G.1, align 4
  switch i32 %LGV, label %SW_D [
    i32 -1829584603, label %SW_C
    i32 -736992176, label %SW_C1
    i32 -1626398054, label %SW_C2
    i32 -1182908425, label %SW_C3
    i32 -1074738250, label %SW_C4
    i32 -1470583435, label %SW_C5
    i32 -8488653, label %SW_C6
  ]

BB:                                               ; preds = %SW_C5, %SW_C3, %SW_C2, %SW_C1, %SW_D
  %1 = fptoui half %a to i32
  ret i32 %1

SW_D:                                             ; preds = %SW_D, %0
  %L = load i1, ptr %A, align 1
  br i1 %L, label %SW_D, label %BB

SW_C:                                             ; preds = %0
  ret i32 %LGV

SW_C1:                                            ; preds = %SW_C1, %0
  %L8 = load i1, ptr %A7, align 1
  br i1 %L8, label %BB, label %SW_C1

SW_C2:                                            ; preds = %0
  br label %BB

SW_C3:                                            ; preds = %0
  br label %BB

SW_C4:                                            ; preds = %0
  ret i32 0

SW_C5:                                            ; preds = %0
  br label %BB

SW_C6:                                            ; preds = %0
  ret i32 %LGV
}

attributes #0 = { nounwind }

Reproduce:

./exec_oracle.py --flags '-mtriple=riscv64 -verify-machineinstrs -target-abi lp64f -mattr=+zfhmin,+m -O2' --funcs zext_fptoui snippet.ll

Local execution result:

7 of 64 inputs differ (first: #12)
SelectionDAG hash 5bef58d3690d6076, GlobalISel hash b0327560e339d2be
b0: llc -mtriple=riscv64 -verify-machineinstrs -target-abi lp64f -mattr=+zfhmin,+m -O2 -global-isel=0
b1: llc -mtriple=riscv64 -verify-machineinstrs -target-abi lp64f -mattr=+zfhmin,+m -O0 -global-isel=0
b2: llc -mtriple=riscv64 -verify-machineinstrs -target-abi lp64f -mattr=+zfhmin,+m -O2 -global-isel -global-isel-abort=2

Occurrences (1):

InputFunctionConfig
rv64zfhmin-half-convert.7fc7c14904.ll (mutant of rv64zfhmin-half-convert.ll)zext_fptoui-mtriple=riscv64 -verify-machineinstrs -target-abi lp64f -mattr=+zfhmin,+m -O2

Generated 2026-11-29 14:49 UTC.