<table border="1" cellspacing="0" cellpadding="8">
    <tr>
        <th>Issue</th>
        <td>
            <a href=https://github.com/llvm/llvm-project/issues/90069>90069</a>
        </td>
    </tr>

    <tr>
        <th>Summary</th>
        <td>
            fatal error: error in backend: Broken function found, compilation aborted
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            new issue
      </td>
    </tr>

    <tr>
      <th>Assignees</th>
      <td>
      </td>
    </tr>

    <tr>
      <th>Reporter</th>
      <td>
          dmitriy-shmilo
      </td>
    </tr>
</table>

<pre>
    While trying to compile a [swift project](https://github.com/dmitriy-shmilo/text-jam-2) for release on windows with `swift build -c release` I get a fatal error and a request to submit the issue here. I guess it has something to do with the TOML library.

This is the output I get:

```
C:\_projects\text-jam-2 (main -> origin)
λ swift build -c release
Building for production...
Function has token parameter but isn't an intrinsic
  call void @arrayReplaceString.cold.1(ptr %5, token %4) #33, !dbg !12276
in function arrayReplaceString
fatal error: error in backend: Broken function found, compilation aborted!
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: C:\\Users\\Admin\\AppData\\Local\\Programs\\Swift\\Toolchains\\5.10.0+Asserts\\usr\\bin\\clang.exe -target x86_64-unknown-windows-msvc -O2 -DSWIFT_PACKAGE=1 -fblocks -I C:\\_projects\\text-jam-2\\.build\\checkouts\\TOMLKit\\Sources\\CTOML\\include -DTOML_EXCEPTIONS=1 -D_CRT_NONSTDC_NO_WARNINGS -D_MT -D_DLL -Xclang --dependent-lib=msvcrt -gdwarf -gdwarf -MD -MT dependencies -MF C:\\_projects\\text-jam-2\\.build\\x86_64-unknown-windows-msvc\\release\\CTOML.build\\Sources\\Array.cpp.d -std=c++17 -c C:\\_projects\\text-jam-2\\.build\\checkouts\\TOMLKit\\Sources\\CTOML\\Sources\\Array.cpp -o C:\\_projects\\text-jam-2\\.build\\x86_64-unknown-windows-msvc\\release\\CTOML.build\\Sources\\Array.cpp.o
1.      <eof> parser at end of file
2.      Code generation
3.      Running pass 'Function Pass Manager' on module 'C:\_projects\text-jam-2\.build\checkouts\TOMLKit\Sources\CTOML\Sources\Array.cpp'.
4.      Running pass 'Module Verifier' on function '@arrayReplaceString'
Exception Code: 0xE0000046
 #0 0x00007ff97cfdab89 (C:\Windows\System32\KERNELBASE.dll+0x2ab89)
 #1 0x00007ff6ec95316a (C:\Users\Admin\AppData\Local\Programs\Swift\Toolchains\5.10.0+Asserts\usr\bin\clang.exe+0x16e316a)
 #2 0x00007ff6ec956a33 (C:\Users\Admin\AppData\Local\Programs\Swift\Toolchains\5.10.0+Asserts\usr\bin\clang.exe+0x16e6a33)
 #3 0x00007ff6eb2f5c70 (C:\Users\Admin\AppData\Local\Programs\Swift\Toolchains\5.10.0+Asserts\usr\bin\clang.exe+0x85c70)
 #4 0x00007ff6ec927356 (C:\Users\Admin\AppData\Local\Programs\Swift\Toolchains\5.10.0+Asserts\usr\bin\clang.exe+0x16b7356)
 #5 0x00007ff6ec9274f1 (C:\Users\Admin\AppData\Local\Programs\Swift\Toolchains\5.10.0+Asserts\usr\bin\clang.exe+0x16b74f1)
 #6 0x00007ff6ec3e5c20 (C:\Users\Admin\AppData\Local\Programs\Swift\Toolchains\5.10.0+Asserts\usr\bin\clang.exe+0x1175c20)
 #7 0x00007ff6ec2d5689 (C:\Users\Admin\AppData\Local\Programs\Swift\Toolchains\5.10.0+Asserts\usr\bin\clang.exe+0x1065689)
 #8 0x00007ff6ec2d58e0 (C:\Users\Admin\AppData\Local\Programs\Swift\Toolchains\5.10.0+Asserts\usr\bin\clang.exe+0x10658e0)
 #9 0x00007ff6ec2d5b97 (C:\Users\Admin\AppData\Local\Programs\Swift\Toolchains\5.10.0+Asserts\usr\bin\clang.exe+0x1065b97)
#10 0x00007ff6ec2d5347 (C:\Users\Admin\AppData\Local\Programs\Swift\Toolchains\5.10.0+Asserts\usr\bin\clang.exe+0x1065347)
#11 0x00007ff6ecd2ca35 (C:\Users\Admin\AppData\Local\Programs\Swift\Toolchains\5.10.0+Asserts\usr\bin\clang.exe+0x1abca35)
#12 0x00007ff6ecd2bb36 (C:\Users\Admin\AppData\Local\Programs\Swift\Toolchains\5.10.0+Asserts\usr\bin\clang.exe+0x1abbb36)
#13 0x00007ff6ecd2c43d (C:\Users\Admin\AppData\Local\Programs\Swift\Toolchains\5.10.0+Asserts\usr\bin\clang.exe+0x1abc43d)
#14 0x00007ff6ef6f1aa8 (C:\Users\Admin\AppData\Local\Programs\Swift\Toolchains\5.10.0+Asserts\usr\bin\clang.exe+0x4481aa8)
#15 0x00007ff6ee254d47 (C:\Users\Admin\AppData\Local\Programs\Swift\Toolchains\5.10.0+Asserts\usr\bin\clang.exe+0x2fe4d47)
#16 0x00007ff6ed43c9e0 (C:\Users\Admin\AppData\Local\Programs\Swift\Toolchains\5.10.0+Asserts\usr\bin\clang.exe+0x21cc9e0)
#17 0x00007ff6ef6f050b (C:\Users\Admin\AppData\Local\Programs\Swift\Toolchains\5.10.0+Asserts\usr\bin\clang.exe+0x448050b)
#18 0x00007ff6ed43c7ce (C:\Users\Admin\AppData\Local\Programs\Swift\Toolchains\5.10.0+Asserts\usr\bin\clang.exe+0x21cc7ce)
#19 0x00007ff6ed3efa83 (C:\Users\Admin\AppData\Local\Programs\Swift\Toolchains\5.10.0+Asserts\usr\bin\clang.exe+0x217fa83)
#20 0x00007ff6ed4c2bcb (C:\Users\Admin\AppData\Local\Programs\Swift\Toolchains\5.10.0+Asserts\usr\bin\clang.exe+0x2252bcb)
#21 0x00007ff6eb2f6a98 (C:\Users\Admin\AppData\Local\Programs\Swift\Toolchains\5.10.0+Asserts\usr\bin\clang.exe+0x86a98)
#22 0x00007ff6eb2eb88c (C:\Users\Admin\AppData\Local\Programs\Swift\Toolchains\5.10.0+Asserts\usr\bin\clang.exe+0x7b88c)
#23 0x00007ff6ed2ef34a (C:\Users\Admin\AppData\Local\Programs\Swift\Toolchains\5.10.0+Asserts\usr\bin\clang.exe+0x207f34a)
#24 0x00007ff6ec95323f (C:\Users\Admin\AppData\Local\Programs\Swift\Toolchains\5.10.0+Asserts\usr\bin\clang.exe+0x16e323f)
#25 0x00007ff6ed2efa18 (C:\Users\Admin\AppData\Local\Programs\Swift\Toolchains\5.10.0+Asserts\usr\bin\clang.exe+0x207fa18)
#26 0x00007ff6ed266d91 (C:\Users\Admin\AppData\Local\Programs\Swift\Toolchains\5.10.0+Asserts\usr\bin\clang.exe+0x1ff6d91)
#27 0x00007ff6ed266f40 (C:\Users\Admin\AppData\Local\Programs\Swift\Toolchains\5.10.0+Asserts\usr\bin\clang.exe+0x1ff6f40)
#28 0x00007ff6ed24c790 (C:\Users\Admin\AppData\Local\Programs\Swift\Toolchains\5.10.0+Asserts\usr\bin\clang.exe+0x1fdc790)
#29 0x00007ff6eb2ee71a (C:\Users\Admin\AppData\Local\Programs\Swift\Toolchains\5.10.0+Asserts\usr\bin\clang.exe+0x7e71a)
#30 0x00007ff6ef2ea414 (C:\Users\Admin\AppData\Local\Programs\Swift\Toolchains\5.10.0+Asserts\usr\bin\clang.exe+0x407a414)
#31 0x00007ff97e7e7344 (C:\Windows\System32\KERNEL32.DLL+0x17344)
#32 0x00007ff97f3026b1 (C:\Windows\SYSTEM32\ntdll.dll+0x526b1)
clang: error: clang frontend command failed with exit code 70 (use -v to see invocation)
clang version 16.0.0
Target: x86_64-unknown-windows-msvc
Thread model: posix
InstalledDir: C:\Users\Admin\AppData\Local\Programs\Swift\Toolchains\5.10.0+Asserts\usr\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: Array-717e5d.cpp
clang: note: diagnostic msg: C:\Users\Admin\AppData\Local\Temp\Array-717e5d.sh
clang: note: diagnostic msg:

********************
[0/4] Compiling CTOML Sources\Array.cpp
```

The Swift on Windows was installed through a standalone installer. `swift -v` output, in case it matters:

```
C:\_projects\text-jam-2 (main -> origin)
λ swift -v
Swift version 5.10 (swift-5.10-RELEASE)
Target: x86_64-unknown-win
dows-msvc
```

Attached files required by the output:
[Array.zip](https://github.com/llvm/llvm-project/files/15112240/Array.zip)
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJzMmllz-7YRwD8N_LJDDQle0oMfdP7jia-xlDp98oAAKCGmABYAffTTd0BSB1TnnzRNw3o8Eolj8cPuYiFiSYwRW8n5NUpnKF1ckcbulL5me2G1-AzMbi8qdVUo9nn9vBMVB6s_hdyCVUDVvnYlBFA6M--itFBr9QunFqULhMc7a2uD4inCK4RXW2F3TTGiao_wyheP8MryDxv8QvYBRngCpdKgecWJ4aAkvAvJ1LuBd2F3gLKwG6toRMUgoIeWKAvhBrbcAoGSWFIB11ppIJIBAc3_0XBjHbdpir2wYHcchDENhx3XfOT6NtwYEBZ2xIBRe253_VSZ6gZ3fTYPd7dQiUIT_TlC4QKF0-5zsxMGhGkbqcbWje14nArOmqEs7P_b27mrTucvveoMSucnZQDC4z0REgIUL0FpsRUS4UkvaL5Esxn8ijbaJjNX6ubgNFprxRpqhZKjUQ--amRb0M7YqlcuoSaa7LnlGorGgjAS4dwCkSCk1UIaQbuuAJRUFbwpwQAlIdGafD7xuiKUr13D7Yiqio0ihMe11YBwmiI87wdBOE2coRGO49gVIxyxYuu-IozzrBtCSCgPgP8uv2tzZmkUT3uTCwkFoa9cMlc20-2YR1GlaiRzg3YOTDr5hdKWM4SjTu7j7XK6Xh58hUDRbEHzWunWhb7j2lX1dvgKDssBr1pHMwivWncUklYN462nUE3MrsW1mlDuuGrNa60oN4YzMKrRXXHryMYoKojlDHQjwVAtatsbc20JfQXW7Oujx4UjaP8etdpqsgeit82eS-vYofc8lM5_Mlyb7nLK9kL2l3W9IJZ0N7eKkqq77IX1HdbO_brLjVIV3REh-6p0FIWjEOHZ1BiubV_aGN1dFIeBaEXkdsQ_OASWaLeCP8bZS5YEjXyV6l0GfQAI9uaNQvCAIVisn29Wm5fH6fzH6bclihcRBGVRKfpqILg5m9r5u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