<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/58660>58660</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
opt crash with "-guard-widening -pre-isel-intrinsic-lowering"
</td>
</tr>
<tr>
<th>Labels</th>
<td>
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
merlinsun
</td>
</tr>
</table>
<pre>
OS: Ubuntu 22.04.1 LTS
Program:
```console
$ cat test.c
void a() {}
```
Command lines:
```console
$ /emsdk/upstream/emscripten/emcc -c -emit-llvm -O3 -mllvm -disable-llvm-optzns test.c -o test.bc
$ /emsdk/upstream/bin/opt -guard-widening -pre-isel-intrinsic-lowering test.bc -o test.opt.bc
PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace.
Stack dump:
0. Program arguments: /emsdk/upstream/bin/opt -guard-widening -pre-isel-intrinsic-lowering test.bc -o test.opt.bc
1. Running pass 'Function Pass Manager' on module 'test.bc'.
2. Running pass 'Widen guards' on function '@a'
#0 0x000055cb2ccf2503 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (/emsdk/upstream/bin/opt+0x22cf503)
#1 0x000055cb2ccefe5e llvm::sys::RunSignalHandlers() (/emsdk/upstream/bin/opt+0x22cce5e)
#2 0x000055cb2ccf2c4f SignalHandler(int) Signals.cpp:0:0
#3 0x00007f3687c5d520 (/lib/x86_64-linux-gnu/libc.so.6+0x42520)
#4 0x000055cb2c9cbcfe (anonymous namespace)::GuardWideningLegacyPass::runOnFunction(llvm::Function&) (.llvm.14771807522684976719) GuardWidening.cpp:0:0
#5 0x000055cb2c4bc0c5 llvm::FPPassManager::runOnFunction(llvm::Function&) (/emsdk/upstream/bin/opt+0x1a990c5)
#6 0x000055cb2c4c5c43 llvm::FPPassManager::runOnModule(llvm::Module&) (/emsdk/upstream/bin/opt+0x1aa2c43)
#7 0x000055cb2c4bcf61 llvm::legacy::PassManagerImpl::run(llvm::Module&) (/emsdk/upstream/bin/opt+0x1a99f61)
#8 0x000055cb2b6e8b3c main (/emsdk/upstream/bin/opt+0xcc5b3c)
#9 0x00007f3687c44d90 (/lib/x86_64-linux-gnu/libc.so.6+0x29d90)
#10 0x00007f3687c44e40 __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x29e40)
#11 0x000055cb2b648caa _start (/emsdk/upstream/bin/opt+0xc25caa)
Segmentation fault (core dumped)
```
Version:
```console
$ /emsdk/upstream/emscripten/emcc -v
emcc (Emscripten gcc/clang-like replacement + linker emulating GNU ld) 3.1.24 (68a9f990429e0bcfb63b1cde68bad792554350a5)
clang version 16.0.0 (https://github.com/llvm/llvm-project 277c382760bf9575cfa2eac73d5ad1db91466d3f)
Target: wasm32-unknown-emscripten
Thread model: posix
InstalledDir: /emsdk/upstream/bin
```
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJytVttynDgQ_RrmRQUFAnF5mAc7jrOpym5c62Tz6BJSw7AWYgoJX_brtyWYGeNyZcdbceEBWtLpo9PdqOtBPm-_3gbpBfleT9pOhNIozqKEfPl2G8RXQXwx_96MQzvyHicu1jyeLzFoMyhYrDQjgltiwdhIzLaHoZOEB7QMaEWC4jIorl5BvPTzYeh7riVRnQZzhreAXkNv5D3ep72xIyBHbxJjt7eg_YsQJMQL-s6GSj30JPyakrCfH2VneK3AD4TD3v6jzcKfhMP8VIv_clh3zhOuJmE78VGGj50E3emWhPsRws6ACjttx06bToRqeITRDR7gj54Q4ejt5svHi9uPxEw18iac1FNLRtgPI-o7kJ21ey8Qvcar7exuqiMxODJuJ8sNvQ9_g7D42hkzoaT0mjh9Oy3UJIHYHRAxcrMjNRf3duQCotn9rUUDkVO_P4YhxqFqyQTCx3bqQVtH4teq8jNREkfhz0l7lD03Bl0X15MWths0uXGG37nmLYxoJ2jqBzkpcLMOoaTFskP6FtYPR5F4umaBaA7w-B5kMXc3D4CGNCbxU4x_jImaCtFQFqfER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