<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/92692>92692</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
Segmentation fault when compiling LLVM IR with inalloca attribute using Clang-18 and Clang-19.0.0.git
</td>
</tr>
<tr>
<th>Labels</th>
<td>
new issue
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
iamanonymouscs
</td>
</tr>
</table>
<pre>
# Command
`clang++-18 code.ll -O1`
Additionally, I observed that in some older versions, the compilation process times out and is killed by the system.(see https://godbolt.org/z/Y49xrW999)
# Code
`cat code.ll`
```
define void @f(ptr inalloca(token)) {
ret void
}
```
# Version
`clang++-18 --version`
```sh
Ubuntu clang version 18.1.4 (++20240410110416+b6ebea7972cd-1~exp1~20240410230431.95)
Target: x86_64-pc-linux-gnu
Thread model: posix
InstalledDir: /usr/bin
```
`clang --version`
```sh
clang version 19.0.0git (https://github.com/llvm/llvm-project.git 987087df90026605fc8d03ebda5a1cd31b71e609)
Target: x86_64-unknown-linux-gnu
Thread model: posix
```
# Error Output
```sh
warning: overriding the module target triple with x86_64-pc-linux-gnu [-Woverride-module]
PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace, preprocessed source, and associated run script.
Stack dump:
0. Program arguments: /usr/lib/llvm-18/bin/clang -cc1 -triple x86_64-pc-linux-gnu -emit-obj -dumpdir a- -disable-free -clear-ast-before-backend -disable-llvm-verifier -discard-value-names -main-file-name code.ll -mrelocation-model pic -pic-level 2 -pic-is-pie -mframe-pointer=none -fmath-errno -ffp-contract=on -fno-rounding-math -mconstructor-aliases -funwind-tables=2 -target-cpu x86-64 -tune-cpu generic -debugger-tuning=gdb -fdebug-compilation-dir=/home -fcoverage-compilation-dir=/home -resource-dir /usr/lib/llvm-18/lib/clang/18 -O1 -ferror-limit 19 -fgnuc-version=4.2.1 -fskip-odr-check-in-gmf -fcolor-diagnostics -faddrsig -D__GCC_HAVE_DWARF2_CFI_ASM=1 -o /tmp/code-84f3f9.o -x ir code.ll
1. Code generation
2. Running pass 'Function Pass Manager' on module 'code.ll'.
3. Running pass 'X86 DAG->DAG Instruction Selection' on function '@f'
#0 0x00007f14b6747b06 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (/usr/lib/llvm-18/bin/../lib/libLLVM.so.18.1+0xd93b06)
#1 0x00007f14b6745ab0 llvm::sys::RunSignalHandlers() (/usr/lib/llvm-18/bin/../lib/libLLVM.so.18.1+0xd91ab0)
#2 0x00007f14b67481d0 (/usr/lib/llvm-18/bin/../lib/libLLVM.so.18.1+0xd941d0)
#3 0x00007f14b5591090 (/usr/lib/x86_64-linux-gnu/libc.so.6+0x43090)
#4 0x00007f14b6798613 (/usr/lib/llvm-18/bin/../lib/libLLVM.so.18.1+0xde4613)
#5 0x0000559574d017a0
clang++-18: error: unable to execute command: Segmentation fault (core dumped)
clang++-18: error: clang frontend command failed due to signal (use -v to see invocation)
Ubuntu clang version 18.1.4 (++20240410110416+b6ebea7972cd-1~exp1~20240410230431.95)
Target: x86_64-pc-linux-gnu
Thread model: posix
InstalledDir: /usr/bin
clang++-18: note: diagnostic msg: Error generating preprocessed source(s) - no preprocessable inputs.
```
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJzcV0tv3DgS_jX0pUCBpNRS69CHtjudCZAgQTyb7J4MSiypOZZIgaT82MP89gUp-RGPnX0gpw0Ct0QW6_Gx6quS9F73BnFHNudkcziTczhZt9NylMaa-9HOvvVnjVX3OyJyuLDjKI0i7EDYnpSsHaTpiTgn4pzyLbRWYTYMQD9zUrJVKv3dK6WDtkYOwz0RF_ABbOPR3aCCcJIBtAFvRwQ7KHRwg85ra3yUDCeE1o6THmRUAJOzLXoPQY_owc4BpFGgPVzrYUAFzX064u99wDEjYusR4RTC5Em-J-JIxLG3qrFDyKzriTj-k4jjP4r6zn2v65qIenU7RavwKVQZHuJ7iq1k6__0qrDT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