miscompile: miscompile rv64: addi,andi,auipc,beq,beqz,bne

Run:explore-b577f07195-20261129-105236
Kind:miscompile
Category:miscompile rv64: addi,andi,auipc,beq,beqz,bne M
Occurrences:1 in 1 configs, 1 test files
Snippet from:tagged-globals.f6d71e3df1.ll (mutant of tagged-globals.ll) @global_addr via llvm-extract
Config:-mtriple=riscv64 --relocation-model=static -mattr=+m -O3 -verify-machineinstrs
Local check:reproduces at b577f07195
Compiler Explorer:not applicable: Compiler Explorer compiles RISC-V but cannot run it

Snippet:

@global_ext = external global i32
@G = external global i16
@G.1 = external global i1

define ptr @global_addr() #0 {
  %A8 = alloca ptr, align 8
  store ptr poison, ptr %A8, align 8
  %A = alloca i1, align 1
  store i1 false, ptr %A, align 1
  %LGV = load i16, ptr @G, align 2
  switch i16 %LGV, label %SW_D [
    i16 -27864, label %SW_C
    i16 -14761, label %SW_C1
    i16 12517, label %SW_C2
    i16 25765, label %SW_C3
    i16 -10321, label %SW_C4
  ]

BB:                                               ; preds = %SW_C4, %SW_C3, %SW_C2, %SW_C1, %SW_C, %SW_D
  ret ptr @global_ext

SW_D:                                             ; preds = %0
  br label %BB

SW_C:                                             ; preds = %SW_C, %0
  %L = load i1, ptr %A, align 1
  br i1 %L, label %SW_C, label %BB

SW_C1:                                            ; preds = %0
  br label %BB

SW_C2:                                            ; preds = %SW_C2, %0
  %LGV5 = load i1, ptr @G.1, align 1
  br i1 %LGV5, label %BB, label %SW_C2

SW_C3:                                            ; preds = %0
  %G = getelementptr i128, ptr %A, i32 42
  store ptr %G, ptr %A8, align 8
  br label %BB

SW_C4:                                            ; preds = %0
  br label %BB
}

attributes #0 = { "target-features"="+tagged-globals" }

Reproduce:

./exec_oracle.py --flags '-mtriple=riscv64 --relocation-model=static -mattr=+m -O3 -verify-machineinstrs' --funcs global_addr snippet.ll

Local execution result:

64 of 64 inputs differ (first: #0)
SelectionDAG hash 466eda833eee9705, GlobalISel hash 6fd8928c94b993f2
b0: llc -mtriple=riscv64 --relocation-model=static -mattr=+m -verify-machineinstrs -O3 -global-isel=0
b1: llc -mtriple=riscv64 --relocation-model=static -mattr=+m -verify-machineinstrs -O0 -global-isel=0
b2: llc -mtriple=riscv64 --relocation-model=static -mattr=+m -verify-machineinstrs -O3 -global-isel -global-isel-abort=2

Occurrences (1):

InputFunctionConfig
tagged-globals.f6d71e3df1.ll (mutant of tagged-globals.ll)global_addr-mtriple=riscv64 --relocation-model=static -mattr=+m -O3 -verify-machineinstrs

Generated 2026-11-29 14:49 UTC.