miscompile: miscompile rv64: add,addi,addw,andi,beqz,bnez

Run:explore-b577f07195-20261129-105236
Kind:miscompile
Category:miscompile rv64: add,addi,addw,andi,beqz,bnez NEW M
Occurrences:1 in 1 configs, 1 test files
Snippet from:rv64zfhmin-half-convert.c7c1c5c2.7de34199.f9cbf406.9f0f81b4.72117bcf8e.ll (mutant of rv64zfhmin-half-convert.c7c1c5c2.7de34199.f9cbf406.9f0f81b4.ll) @zext_fptoui via llvm-extract
Config:-mtriple=riscv64 -verify-machineinstrs -target-abi lp64f -mattr=+zfhmin,+f,+m -O0 -code-model=small
Local check:reproduces at b577f07195
Compiler Explorer:not applicable: Compiler Explorer compiles RISC-V but cannot run it

Snippet:

@G = external global i32
@G.3 = external global i8
@G.4 = external global i8
@G.7 = external global i64
@G.10 = external global i1

; Function Attrs: nounwind
define zeroext i32 @zext_fptoui(half %a) #0 {
  %A9 = alloca half, align 2
  store half poison, ptr %A9, align 2
  %C7 = fcmp ugt half %a, %a
  %A4 = alloca i1, align 1
  store i1 poison, ptr %A4, align 1
  %A7 = alloca i1, align 1
  store i1 %C7, ptr %A7, align 1
  %A = alloca i1, align 1
  store i1 false, ptr %A, align 1
  %LGV1 = load i8, ptr @G.3, align 1
  %L = load i1, ptr %A, align 1
  br i1 %L, label %T, label %F

BB:                                               ; preds = %F, %T
  %1 = fptoui half %a to i32
  %B6 = and i1 %L, true
  %B = xor i32 %1, 0
  store i32 %B, ptr @G, align 4
  %B2 = ashr i8 127, %LGV1
  store i8 %B2, ptr @G.4, align 1
  %G = getelementptr i8, ptr %A7, i1 %B6
  store i1 %B6, ptr %G, align 1
  ret i32 %1

T:                                                ; preds = %T, %0
  %LGV = load i64, ptr @G.7, align 4
  %C3 = fcmp true double f0x7FEFFFFFFFFFFFFF, +qnan
  %B8 = frem half 1.000000e+00, +inf
  %B4 = ashr i64 %LGV, 0
  %C = icmp sgt i64 %LGV, %LGV
  %B1 = add i1 true, %L
  store i64 %B4, ptr %A, align 4
  store i1 %C, ptr @G.10, align 1
  store i1 %C3, ptr %A4, align 1
  store half %B8, ptr %A9, align 2
  br i1 %B1, label %BB, label %T

F:                                                ; preds = %0
  %B3 = lshr i64 0, 4294967296
  store i64 %B3, ptr %A, align 4
  br label %BB
}

attributes #0 = { nounwind }

Reproduce:

./exec_oracle.py --flags '-mtriple=riscv64 -verify-machineinstrs -target-abi lp64f -mattr=+zfhmin,+f,+m -O0 -code-model=small' --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,+f,+m -code-model=small -O0 -global-isel=0
b1: llc -mtriple=riscv64 -verify-machineinstrs -target-abi lp64f -mattr=+zfhmin,+f,+m -code-model=small -O2 -global-isel=0
b2: llc -mtriple=riscv64 -verify-machineinstrs -target-abi lp64f -mattr=+zfhmin,+f,+m -code-model=small -O0 -global-isel -global-isel-abort=2

Occurrences (1):

InputFunctionConfig
rv64zfhmin-half-convert.c7c1c5c2.7de34199.f9cbf406.9f0f81b4.72117bcf8e.ll (mutant of rv64zfhmin-half-convert.c7c1c5c2.7de34199.f9cbf406.9f0f81b4.ll)zext_fptoui-mtriple=riscv64 -verify-machineinstrs -target-abi lp64f -mattr=+zfhmin,+f,+m -O0 -code-model=small

Generated 2026-11-29 14:49 UTC.