miscompile: miscompile rv64: add,addi,ld,li,lui,mul
| Run: | explore-d9924131a4-20261128-105811 |
| Kind: | miscompile |
| Category: | miscompile rv64: add,addi,ld,li,lui,mul NEW M |
| Occurrences: | 1 in 1 configs, 1 test files |
| Snippet from: | memset-inline.a738fe63.eea2c2b3.883f842507.ll (mutant of memset-inline.a738fe63.eea2c2b3.ll) @aligned_memset_zero_2 via full input |
| Config: | -mtriple=riscv64 -verify-machineinstrs -mattr=+m,+v,+unaligned-scalar-mem,+unaligned-vector-mem,+f,+c -O3 |
| Local check: | reproduces at d9924131a4 |
| Compiler Explorer: | not applicable: Compiler Explorer compiles RISC-V but cannot run it |
Snippet:
; ModuleID = '<stdin>'
source_filename = "<stdin>"
@G = global <4 x float> splat (float 1.000000e+00)
@G.2 = global <4 x i32> splat (i32 2147483647)
@G.3 = global <4 x i32> zeroinitializer
@G.1 = global i128 -1
@G.4 = global ptr poison
@G.5 = global i8 127
@G.6 = global i1 false
@G.7 = global i128 170141183460469231731687303715884105727
@G.8 = global <4 x i1> splat (i1 true)
; Function Attrs: nounwind
declare void @memset_1(ptr, i8) #0
; Function Attrs: nounwind
declare void @memset_2(ptr, i8) #0
; Function Attrs: nounwind
declare void @memset_4(ptr, i8) #0
; Function Attrs: nounwind
declare void @memset_8(ptr, i8) #0
; Function Attrs: nounwind
declare void @memset_16(ptr, i8) #0
; Function Attrs: nounwind
declare void @memset_32(ptr, i8) #0
; Function Attrs: nounwind
declare void @memset_64(ptr, i8) #0
; Function Attrs: nounwind
declare void @aligned_memset_2(ptr align 2, i8) #0
; Function Attrs: nounwind
declare void @aligned_memset_4(ptr align 4, i8) #0
; Function Attrs: nounwind
declare void @aligned_memset_8(ptr align 8, i8) #0
; Function Attrs: nounwind
declare void @aligned_memset_16(ptr align 16, i8) #0
; Function Attrs: nounwind
declare void @aligned_memset_32(ptr align 32, i8) #0
; Function Attrs: nounwind
declare void @aligned_memset_64(ptr align 64, i8) #0
; Function Attrs: nounwind
declare void @memset_zero_1(ptr) #0
; Function Attrs: nounwind
declare void @memset_zero_2(ptr) #0
; Function Attrs: nounwind
declare void @memset_zero_4(ptr) #0
; Function Attrs: nounwind
declare void @memset_zero_8(ptr) #0
; Function Attrs: nounwind
declare void @memset_zero_16(ptr) #0
; Function Attrs: nounwind
declare void @memset_zero_32(ptr) #0
; Function Attrs: nounwind
declare void @memset_zero_64(ptr) #0
; Function Attrs: nounwind
define void @aligned_memset_zero_2(ptr %a) #0 {
%G1 = getelementptr ptr, ptr %a, i16 -1
%LGV = load i128, ptr @G.1, align 4
%G = getelementptr ptr, ptr %a, i128 %LGV
%E = extractelement <8 x i8> splat (i8 -1), i8 -1
tail call void @llvm.memset.inline.p0.i64(ptr align 2 %a, i8 %E, i64 2, i1 false)
store ptr %G, ptr @G.4, align 8
store ptr %G1, ptr %G, align 8
ret void
}
; Function Attrs: nounwind
declare void @aligned_memset_zero_4(ptr) #0
; Function Attrs: nounwind
declare void @aligned_memset_zero_8(ptr) #0
; Function Attrs: nounwind
declare void @aligned_memset_zero_16(ptr) #0
; Function Attrs: nounwind
declare void @aligned_memset_zero_32(ptr) #0
; Function Attrs: nounwind
declare void @aligned_memset_zero_64(ptr) #0
; Function Attrs: nounwind
declare void @aligned_memset_zero_66(ptr) #0
; Function Attrs: nounwind
declare void @aligned_memset_zero_96(ptr) #0
; Function Attrs: nounwind
declare void @aligned_memset_zero_128(ptr) #0
; Function Attrs: nounwind
define void @aligned_memset_zero_256(ptr %a) #0 {
%LGV1 = load i128, ptr @G.7, align 4
%G = getelementptr ptr, ptr %a, i128 %LGV1
%G1 = getelementptr i128, ptr %G, i128 %LGV1
%B = fsub <4 x float> splat (float 1.000000e+00), splat (float 1.000000e+00)
tail call void %G(ptr align 64 %a, i8 0, i64 256, i1 false)
store <4 x float> %B, ptr @G, align 16
store ptr %G1, ptr @G.4, align 8
ret void
}
; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: write)
declare void @llvm.memset.inline.p0.i64(ptr writeonly captures(none), i8, i64, i1 immarg) #1
attributes #0 = { nounwind }
attributes #1 = { nocallback nofree nosync nounwind willreturn memory(argmem: write) }
Reproduce:
./exec_oracle.py --flags '-mtriple=riscv64 -verify-machineinstrs -mattr=+m,+v,+unaligned-scalar-mem,+unaligned-vector-mem,+f,+c -O3' --funcs aligned_memset_zero_2 snippet.ll
Local execution result:
64 of 64 inputs differ (first: #0)
SelectionDAG hash c6068328bf1585d7, GlobalISel hash f99b0a0cb41e452f
b0: llc -mtriple=riscv64 -verify-machineinstrs -mattr=+m,+v,+unaligned-scalar-mem,+unaligned-vector-mem,+f,+c -O3 -global-isel=0
b1: llc -mtriple=riscv64 -verify-machineinstrs -mattr=+m,+v,+unaligned-scalar-mem,+unaligned-vector-mem,+f,+c -O0 -global-isel=0
b2: llc -mtriple=riscv64 -verify-machineinstrs -mattr=+m,+v,+unaligned-scalar-mem,+unaligned-vector-mem,+f,+c -O3 -global-isel -global-isel-abort=2
Occurrences (1):
| Input | Function | Config |
|---|
| memset-inline.a738fe63.eea2c2b3.883f842507.ll (mutant of memset-inline.a738fe63.eea2c2b3.ll) | aligned_memset_zero_2 | -mtriple=riscv64 -verify-machineinstrs -mattr=+m,+v,+unaligned-scalar-mem,+unaligned-vector-mem,+f,+c -O3 |
Generated 2026-11-29 14:49 UTC.