<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/54586>54586</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
[CLANG-M68K] 14.0.0 clang crashes with -O1, and above, optimisation
</td>
</tr>
<tr>
<th>Labels</th>
<td>
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
djipi
</td>
</tr>
</table>
<pre>
2. Code generation
3. Running pass 'Function Pass Manager' on module '../game/g_ai.c'.
4. Running pass 'M68k DAG->DAG Pattern Instruction Selection' on function '@ai_stand'
#0 0x00007ff6f1a823e9 (C:\LLVM\m68k-elf-clang-14.0.0\bin\clang.exe+0x16223e9)
#1 0x00007ff6f1a81b69 (C:\LLVM\m68k-elf-clang-14.0.0\bin\clang.exe+0x1621b69)
#2 0x00007ff6f1a830fb (C:\LLVM\m68k-elf-clang-14.0.0\bin\clang.exe+0x16230fb)
#3 0x00007ff6f194aaa9 (C:\LLVM\m68k-elf-clang-14.0.0\bin\clang.exe+0x14eaaa9)
#4 0x00007ff6f194f485 (C:\LLVM\m68k-elf-clang-14.0.0\bin\clang.exe+0x14ef485)
#5 0x00007ff6f1955b83 (C:\LLVM\m68k-elf-clang-14.0.0\bin\clang.exe+0x14f5b83)
#6 0x00007ff6f07271a4 (C:\LLVM\m68k-elf-clang-14.0.0\bin\clang.exe+0x2c71a4)
#7 0x00007ff6f09a2b88 (C:\LLVM\m68k-elf-clang-14.0.0\bin\clang.exe+0x542b88)
#8 0x00007ff6f09a2dd3 (C:\LLVM\m68k-elf-clang-14.0.0\bin\clang.exe+0x542dd3)
#9 0x00007ff6f09a3017 (C:\LLVM\m68k-elf-clang-14.0.0\bin\clang.exe+0x543017)
#10 0x00007ff6f09a2890 (C:\LLVM\m68k-elf-clang-14.0.0\bin\clang.exe+0x542890)
#11 0x00007ff6f114b178 (C:\LLVM\m68k-elf-clang-14.0.0\bin\clang.exe+0xceb178)
#12 0x00007ff6f114cc31 (C:\LLVM\m68k-elf-clang-14.0.0\bin\clang.exe+0xcecc31)
#13 0x00007ff6f3286bee (C:\LLVM\m68k-elf-clang-14.0.0\bin\clang.exe+0x2e26bee)
#14 0x00007ff6f2390d94 (C:\LLVM\m68k-elf-clang-14.0.0\bin\clang.exe+0x1f30d94)
#15 0x00007ff6f16d8be7 (C:\LLVM\m68k-elf-clang-14.0.0\bin\clang.exe+0x1278be7)
#16 0x00007ff6f32859e8 (C:\LLVM\m68k-elf-clang-14.0.0\bin\clang.exe+0x2e259e8)
#17 0x00007ff6f16d8662 (C:\LLVM\m68k-elf-clang-14.0.0\bin\clang.exe+0x1278662)
#18 0x00007ff6f16a2ab2 (C:\LLVM\m68k-elf-clang-14.0.0\bin\clang.exe+0x1242ab2)
#19 0x00007ff6f173dab8 (C:\LLVM\m68k-elf-clang-14.0.0\bin\clang.exe+0x12ddab8)
#20 0x00007ff6f04d9982 (C:\LLVM\m68k-elf-clang-14.0.0\bin\clang.exe+0x79982)
#21 0x00007ff6f04d48f7 (C:\LLVM\m68k-elf-clang-14.0.0\bin\clang.exe+0x748f7)
#22 0x00007ff6f15c3337 (C:\LLVM\m68k-elf-clang-14.0.0\bin\clang.exe+0x1163337)
#23 0x00007ff6f0e91fef (C:\LLVM\m68k-elf-clang-14.0.0\bin\clang.exe+0xa31fef)
#24 0x00007ff6f15c3b40 (C:\LLVM\m68k-elf-clang-14.0.0\bin\clang.exe+0x1163b40)
#25 0x00007ff6f15424e0 (C:\LLVM\m68k-elf-clang-14.0.0\bin\clang.exe+0x10e24e0)
#26 0x00007ff6f154282d (C:\LLVM\m68k-elf-clang-14.0.0\bin\clang.exe+0x10e282d)
#27 0x00007ff6f152a2a8 (C:\LLVM\m68k-elf-clang-14.0.0\bin\clang.exe+0x10ca2a8)
#28 0x00007ff6f04d6bfb (C:\LLVM\m68k-elf-clang-14.0.0\bin\clang.exe+0x76bfb)
#29 0x00007ff6f2fc6e00 (C:\LLVM\m68k-elf-clang-14.0.0\bin\clang.exe+0x2b66e00)
#30 0x00007fffad7c7034 (C:\WINDOWS\System32\KERNEL32.DLL+0x17034)
#31 0x00007fffaee62651 (C:\WINDOWS\SYSTEM32\ntdll.dll+0x52651)
clang: error: clang frontend command failed due to signal (use -v to see invocation)
clang version 14.0.0
Target: m68k-unknown-unknown-elf
Thread model: posix
InstalledDir: C:\LLVM\m68k-elf-clang-14.0.0\bin
clang: note: diagnostic msg:
********************
PLEASE ATTACH THE FOLLOWING FILES TO THE BUG REPORT:
Preprocessed source(s) and associated run script(s) are located at:
clang: note: diagnostic msg: C:\Users\djipi\AppData\Local\Temp\g_ai-b05f6a.c
clang: note: diagnostic msg: C:\Users\djipi\AppData\Local\Temp\g_ai-b05f6a.sh
clang: note: diagnostic msg:
[g_ai-b05f6a.zip](https://github.com/llvm/llvm-project/files/8358119/g_ai-b05f6a.zip)
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJy9mG2P2jgQxz8NvLGIHDuPL3jB8rBdlV1WC73qXlVOMoG0IUFxst32099MYCmO7nRXWToEcWI7_59nxuPEJHX2Yyoc1n_mdQZsDxU0qi3qasQXIz6Tl8aXrqqKas9OSms2EuGqq1LqxZ6p4lFVag8N1jOsOtZZVwL1cpyRWO3VEaj4ogonpcqzsvcPyo9B9I0tZveTkVxigYC2haZiD5Vum-4M3UIJ_dmFmL-PBq9HHlfFF92qKqOrnoX1kjP-xvET5nmQuyoSEmKsj-YjORv58_X6j0csjkifQJlP0lJV-4nrOdzhWJ8UFR77Sgfe0J47_uYGgkRGIv5FcQcUNwnsKSRiUMSAInmeWFNIxKBIgxJ7SilbWzwgEYPiDSi5F_nWFBIxKL5J8f0kkraUnEQMSnBL4aEIXeXZUURKGgYkNCCxEkkU2UF8jzQMSDSEZJmlvxCCGgYkHkAkd0NbCGlcIZSQfGhJFHNrS1DDgJhp73qJG1rGJAXSMCBiAElTXG4sIaRhQIyklyIKEgDLKQyCRAyKkfQ4EXgWWyaKm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