<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/69365>69365</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
clang++ crash: Assertion `(!Is64Bit || isInt<32>((long long)FIOffset + Imm)) && "Requesting 64-bit offset in 32-bit immediate!"' failed
</td>
</tr>
<tr>
<th>Labels</th>
<td>
clang
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
YangChenyuan
</td>
</tr>
</table>
<pre>
When compiling the following program with `clang++ test.cpp -o exe`
```cpp
#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.
```
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJzMVE1v4zYQ_TXjyyCGRFmSddDBH2vAQIsW2QJtTwFFjSR2KVIlR8nm3xeUnCZOe-qphkGaQ7_H4bw3lCHo3hLVkB8hP2_kzIPz9e_S9qeB7Oss7aZx7Wv960AWlRsnbbTtkQfCzhnjXuJq8q73csQXzQNCkSgjbQ_iCOKITIG3aprwwSF9JygSSM6QHG5jkaxfNU23iMi0VWZuCSE7aRfYkxwh-_IR9ux0i6N8feLBuxcQexAVQnlcd_Fl0IZA7NnPdL-DiAsEA7eQHSA7uJmfXPfkpe1pIRIxYxACRAXZGw7K8-38v38so7aMo9T2PQV8O4n96_3Bn_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