miscompile: miscompile rv64: addi,andi,beq,bne,fcvt.l.s,fcvt.w.s
| Run: | explore-b577f07195-20261129-105236 |
| Kind: | miscompile |
| Category: | miscompile rv64: addi,andi,beq,bne,fcvt.l.s,fcvt.w.s NEW M |
| Occurrences: | 1 in 1 configs, 1 test files |
| Snippet from: | float-convert.43cee8c3.60e4fe72.c128b22561.ll (mutant of float-convert.43cee8c3.60e4fe72.ll) @fcvt_w_s_i16 via llvm-extract |
| Config: | -mtriple=riscv64 -verify-machineinstrs -target-abi=lp64f -mattr=+f,+zcb,+zvbb,+v,+m -O2 |
| Local check: | reproduces at b577f07195 |
| Compiler Explorer: | not applicable: Compiler Explorer compiles RISC-V but cannot run it |
Snippet:
@G.1 = external global i1
@G.5 = external global float
@G.7 = external global i8
@G.9 = external global float
; Function Attrs: nounwind
define signext i16 @fcvt_w_s_i16(float %a) #0 {
%A2 = alloca i1, align 1
store i1 true, ptr %A2, align 1
%LGV = load i8, ptr @G.7, align 1
%LGV1 = load float, ptr @G.5, align 4
switch i8 %LGV, label %SW_D [
i8 -89, label %SW_C
i8 60, label %SW_C1
]
BB: ; preds = %SW_C1, %SW_C, %SW_D
%A = alloca i128, align 8
store i128 poison, ptr %A, align 4
%C4 = fcmp ult float %a, 0.000000e+00
%B = add i128 -1, -170141183460469231731687303715884105728
%1 = fptosi float %a to i16
store i128 %B, ptr %A, align 4
%C = fcmp une float %a, %LGV1
store i1 %C, ptr @G.1, align 1
store i1 %C4, ptr %A2, align 1
ret i16 %1
SW_D: ; preds = %0
br label %BB
SW_C: ; preds = %0
%LGV6 = load float, ptr @G.9, align 4
%C7 = fcmp one float %a, %LGV6
store i1 %C7, ptr @G.1, align 1
br label %BB
SW_C1: ; preds = %SW_C1, %0
%L = load i1, ptr %A2, align 1
br i1 %L, label %BB, label %SW_C1
}
attributes #0 = { nounwind }
Reproduce:
./exec_oracle.py --flags '-mtriple=riscv64 -verify-machineinstrs -target-abi=lp64f -mattr=+f,+zcb,+zvbb,+v,+m -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,+zcb,+zvbb,+v,+m -O2 -global-isel=0
b1: llc -mtriple=riscv64 -verify-machineinstrs -target-abi=lp64f -mattr=+f,+zcb,+zvbb,+v,+m -O0 -global-isel=0
b2: llc -mtriple=riscv64 -verify-machineinstrs -target-abi=lp64f -mattr=+f,+zcb,+zvbb,+v,+m -O2 -global-isel -global-isel-abort=2
Occurrences (1):
| Input | Function | Config |
|---|
| float-convert.43cee8c3.60e4fe72.c128b22561.ll (mutant of float-convert.43cee8c3.60e4fe72.ll) | fcvt_w_s_i16 | -mtriple=riscv64 -verify-machineinstrs -target-abi=lp64f -mattr=+f,+zcb,+zvbb,+v,+m -O2 |
Generated 2026-11-29 14:49 UTC.