miscompile: miscompile rv64: add,addi,andi,beqz,bge,blt

Run:explore-b577f07195-20261129-105236
Kind:miscompile
Category:miscompile rv64: add,addi,andi,beqz,bge,blt M
Occurrences:1 in 1 configs, 1 test files
Snippet from:unaligned-load-store.62ffa59e.d0ef0aa8.2c5e0d34.2869627c29.ll (mutant of unaligned-load-store.62ffa59e.d0ef0aa8.2c5e0d34.ll) @merge_stores_i8_i32 via llvm-extract
Config:-mtriple=riscv64 -verify-machineinstrs -mattr=+zba,+zvfh -O3
Local check:reproduces at b577f07195
Compiler Explorer:not applicable: Compiler Explorer compiles RISC-V but cannot run it

Snippet:

@G = external global i1
@G.3 = external global i128
@G.4 = external global i1
@G.8 = external global i8
@G.9 = external global i1

define void @merge_stores_i8_i32(ptr %p) {
  %B1 = fdiv half 1.000000e+00, 6.550400e+04
  %LGV = load i1, ptr @G.4, align 1
  %LGV1 = load i128, ptr @G.3, align 4
  %B = add i128 170141183460469231731687303715884105727, %LGV1
  store i8 0, ptr %p, align 1
  %p2 = getelementptr inbounds i8, ptr %p, i32 1
  store i8 0, ptr %p2, align 1
  %p3 = getelementptr i8, ptr %p, i32 2
  %L = load i1, ptr %p3, align 1
  store i128 %B, ptr @G.3, align 4
  store half %B1, ptr %p3, align 2
  br i1 %L, label %T, label %F

BB:                                               ; preds = %F
  %G = getelementptr bfloat, ptr %p, i1 false
  store i8 0, ptr %p3, align 1
  %p4 = getelementptr i8, ptr %p, i32 3
  store i8 0, ptr %p4, align 1
  store ptr %G, ptr %p4, align 8
  ret void

T:                                                ; preds = %0
  %1 = phi i1 [ %LGV, %0 ]
  %LGV3 = load i8, ptr @G.8, align 1
  switch i8 %LGV3, label %SW_D [
    i8 114, label %SW_C
    i8 -17, label %SW_C4
    i8 -77, label %SW_C5
    i8 24, label %SW_C6
    i8 -84, label %SW_C7
    i8 -57, label %SW_C8
    i8 61, label %SW_C9
  ]

BB2:                                              ; preds = %SW_C8, %SW_C7, %SW_C4, %SW_C, %SW_D
  store i1 %1, ptr %p2, align 1
  ret void

F:                                                ; preds = %0
  br label %BB

SW_D:                                             ; preds = %T
  br label %BB2

SW_C:                                             ; preds = %SW_C, %T
  %LGV10 = load i1, ptr @G, align 1
  br i1 %L, label %SW_C, label %BB2

SW_C4:                                            ; preds = %SW_C4, %T
  %LGV11 = load i1, ptr @G.9, align 1
  br i1 %LGV11, label %SW_C4, label %BB2

SW_C5:                                            ; preds = %T
  ret void

SW_C6:                                            ; preds = %T
  ret void

SW_C7:                                            ; preds = %T
  br label %BB2

SW_C8:                                            ; preds = %T
  br label %BB2

SW_C9:                                            ; preds = %T
  ret void
}

Reproduce:

./exec_oracle.py --flags '-mtriple=riscv64 -verify-machineinstrs -mattr=+zba,+zvfh -O3' --funcs merge_stores_i8_i32 snippet.ll

Local execution result:

64 of 64 inputs differ (first: #0)
SelectionDAG hash 2c75da33829b3726, GlobalISel hash 34af030589e1ae63
b0: llc -mtriple=riscv64 -verify-machineinstrs -mattr=+zba,+zvfh -O3 -global-isel=0
b1: llc -mtriple=riscv64 -verify-machineinstrs -mattr=+zba,+zvfh -O0 -global-isel=0
b2: llc -mtriple=riscv64 -verify-machineinstrs -mattr=+zba,+zvfh -O3 -global-isel -global-isel-abort=2

Occurrences (1):

InputFunctionConfig
unaligned-load-store.62ffa59e.d0ef0aa8.2c5e0d34.2869627c29.ll (mutant of unaligned-load-store.62ffa59e.d0ef0aa8.2c5e0d34.ll)merge_stores_i8_i32-mtriple=riscv64 -verify-machineinstrs -mattr=+zba,+zvfh -O3

Generated 2026-11-29 14:49 UTC.