Skip to content

clang++ crash: Assertion `(!Is64Bit || isInt<32>((long long)FIOffset + Imm)) && "Requesting 64-bit offset in 32-bit immediate!"' failed #69365

@YangChenyuan

Description

@YangChenyuan

When compiling the following program with clang++ test.cpp -o exe

#include <iostream>

void may_throw() {
  while(true) {
    throw std::out_of_range("test");
  }
}

int main() { 
  try {
    may_throw();
    volatile int a[1000000000] = {};
    return 1/ (a[500000000] & 1);
  } catch (...) {
    return -1;
  }
}

I encountered the following crash

clang-18: /llvm-project/llvm/lib/Target/X86/X86RegisterInfo.cpp:900: virtual bool llvm::X86RegisterInfo::eliminateFrameIndex(llvm::MachineBasicBlock::iterator, int, unsigned int, llvm::RegScavenger*) const: Assertion `(!Is64Bit || isInt<32>((long long)FIOffset + Imm)) && "Requesting 64-bit offset in 32-bit immediate!"' failed.
PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace, preprocessed source, and associated run script.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions