miscompile: miscompile rv32: add,addi,and,beqz,fabs.h,fadd.h

Run:explore-b577f07195-20261129-105236
Kind:miscompile
Category:miscompile rv32: add,addi,and,beqz,fabs.h,fadd.h NEW M
Occurrences:1 in 1 configs, 1 test files
Snippet from:half-round-conv.cac5873d.3881cb25.d9b1b961.4e9c03ebf7.ll (mutant of half-round-conv.cac5873d.3881cb25.d9b1b961.ll) @test_trunc_ui8 via llvm-extract
Config:-mtriple=riscv32 -verify-machineinstrs -target-abi=ilp32f -mattr=+zfh,+zbb,+f -O3
Local check:reproduces at b577f07195
Compiler Explorer:not applicable: Compiler Explorer compiles RISC-V but cannot run it

Snippet:

@G.1 = external global half
@G.3 = external global half
@G.4 = external global i1
@G.7 = external global ptr
@G.8 = external global i1

define zeroext i8 @test_trunc_ui8(half %x) {
  %LGV1 = load half, ptr @G.3, align 2
  %A = alloca i1, align 1
  store i1 poison, ptr %A, align 1
  %LGV = load half, ptr @G.1, align 2
  %a = call half @llvm.trunc.f16(half %x)
  %C2 = fcmp ord half %LGV1, %LGV
  %B = fadd half %x, %LGV1
  %b = fptoui half %a to i8
  %G = getelementptr half, ptr %A, i8 %b
  %C = fcmp oeq half %x, %LGV
  %C1 = icmp ult i8 %b, 0
  store i1 %C, ptr %A, align 1
  store i1 %C2, ptr @G.4, align 1
  store half %B, ptr @G.3, align 2
  store ptr %G, ptr @G.7, align 8
  store i1 %C1, ptr @G.8, align 1
  ret i8 %b
}

; Function Attrs: nocallback nocreateundeforpoison nofree nosync nounwind speculatable willreturn memory(none)
declare half @llvm.trunc.f16(half) #0

attributes #0 = { nocallback nocreateundeforpoison nofree nosync nounwind speculatable willreturn memory(none) }

Reproduce:

./exec_oracle.py --flags '-mtriple=riscv32 -verify-machineinstrs -target-abi=ilp32f -mattr=+zfh,+zbb,+f -O3' --funcs test_trunc_ui8 snippet.ll

Local execution result:

9 of 64 inputs differ (first: #12)
SelectionDAG hash c7c80994735a01b2, GlobalISel hash 50322c310da047ea
b0: llc -mtriple=riscv32 -verify-machineinstrs -target-abi=ilp32f -mattr=+zfh,+zbb,+f -O3 -global-isel=0
b1: llc -mtriple=riscv32 -verify-machineinstrs -target-abi=ilp32f -mattr=+zfh,+zbb,+f -O0 -global-isel=0
b2: llc -mtriple=riscv32 -verify-machineinstrs -target-abi=ilp32f -mattr=+zfh,+zbb,+f -O3 -global-isel -global-isel-abort=2

Occurrences (1):

InputFunctionConfig
half-round-conv.cac5873d.3881cb25.d9b1b961.4e9c03ebf7.ll (mutant of half-round-conv.cac5873d.3881cb25.d9b1b961.ll)test_trunc_ui8-mtriple=riscv32 -verify-machineinstrs -target-abi=ilp32f -mattr=+zfh,+zbb,+f -O3

Generated 2026-11-29 14:49 UTC.