<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/64008>64008</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
Clang crashes when used with -mllvm -global-isel
</td>
</tr>
<tr>
<th>Labels</th>
<td>
new issue
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
SAtacker
</td>
</tr>
</table>
<pre>
Backtrace and invocation command:
```
/usr/bin/clang++-15 -DHPX_APPLICATION_EXPORTS -DHPX_APPLICATION_NAME_DEFAULT=my_hpx_program_parallel -DHPX_PREFIX_DEFAULT=\"/usr/local\" -stdlib=libc++ -std=c++20 -Ofast -ffast-math -mllvm -global-isel -O3 -DNDEBUG -pthread -std=gnu++20 -MD -MT CMakeFiles/my_hpx_program_parallel.dir/example_parallel.cpp.o -MF CMakeFiles/my_hpx_program_parallel.dir/example_parallel.cpp.o.d -o CMakeFiles/my_hpx_program_parallel.dir/example_parallel.cpp.o -c ../example_parallel.cpp
fatal error: error in backend: unable to legalize instruction: %76:_(s64) = G_UITOFP %2:_(s64) (in function: _Z18print_time_resultsjmmmmmb)
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/bin/clang++-15 -DHPX_APPLICATION_EXPORTS -DHPX_APPLICATION_NAME_DEFAULT=my_hpx_program_parallel -DHPX_PREFIX_DEFAULT=\"/usr/local\" -stdlib=libc++ -std=c++20 -Ofast -ffast-math -mllvm -global-isel -O3 -DNDEBUG -pthread -std=gnu++20 -MD -MT CMakeFiles/my_hpx_program_parallel.dir/example_parallel.cpp.o -MF CMakeFiles/my_hpx_program_parallel.dir/example_parallel.cpp.o.d -o CMakeFiles/my_hpx_program_parallel.dir/example_parallel.cpp.o -c ../example_parallel.cpp
1. <eof> parser at end of file
2. Code generation
3. Running pass 'Function Pass Manager' on module '../example_parallel.cpp'.
4. Running pass 'Legalizer' on function '@_Z18print_time_resultsjmmmmmb'
Stack dump without symbol names (ensure you have llvm-symbolizer in your PATH or set the environment var `LLVM_SYMBOLIZER_PATH` to point to it):
/usr/lib/llvm-15/bin/../lib/libLLVM-15.so.1(_ZN4llvm3sys15PrintStackTraceERNS_11raw_ostreamEi+0x31)[0x7f66e85043b1]
/usr/lib/llvm-15/bin/../lib/libLLVM-15.so.1(_ZN4llvm3sys17RunSignalHandlersEv+0xee)[0x7f66e85020fe]
/usr/lib/llvm-15/bin/../lib/libLLVM-15.so.1(_ZN4llvm3sys15CleanupOnSignalEm+0x101)[0x7f66e8503771]
/usr/lib/llvm-15/bin/../lib/libLLVM-15.so.1(+0xe2745a)[0x7f66e842745a]
/usr/lib/llvm-15/bin/../lib/libLLVM-15.so.1(+0xe273fb)[0x7f66e84273fb]
/usr/lib/llvm-15/bin/../lib/libLLVM-15.so.1(_ZN4llvm3sys7Process4ExitEib+0x27)[0x7f66e84fe5c7]
/usr/bin/clang++-15(+0x14012)[0x55571b8cf012]
/usr/lib/llvm-15/bin/../lib/libLLVM-15.so.1(_ZN4llvm18report_fatal_errorERKNS_5TwineEb+0x109)[0x7f66e8439339]
/usr/lib/llvm-15/bin/../lib/libLLVM-15.so.1(+0x18ef25c)[0x7f66e8eef25c]
/usr/lib/llvm-15/bin/../lib/libLLVM-15.so.1(_ZN4llvm18reportGISelFailureERNS_15MachineFunctionERKNS_16TargetPassConfigERNS_32MachineOptimizationRemarkEmitterEPKcNS_9StringRefERKNS_12MachineInstrE+0x313)[0x7f66e8eef5a3]
/usr/lib/llvm-15/bin/../lib/libLLVM-15.so.1(_ZN4llvm9Legalizer20runOnMachineFunctionERNS_15MachineFunctionE+0x3be)[0x7f66e8e9c70e]
/usr/lib/llvm-15/bin/../lib/libLLVM-15.so.1(_ZN4llvm19MachineFunctionPass13runOnFunctionERNS_8FunctionE+0x1fc)[0x7f66e8893efc]
/usr/lib/llvm-15/bin/../lib/libLLVM-15.so.1(_ZN4llvm13FPPassManager13runOnFunctionERNS_8FunctionE+0x3b2)[0x7f66e8640c92]
/usr/lib/llvm-15/bin/../lib/libLLVM-15.so.1(_ZN4llvm13FPPassManager11runOnModuleERNS_6ModuleE+0x33)[0x7f66e8648253]
/usr/lib/llvm-15/bin/../lib/libLLVM-15.so.1(_ZN4llvm6legacy15PassManagerImpl3runERNS_6ModuleE+0x936)[0x7f66e8641836]
/usr/lib/llvm-15/bin/../lib/libclang-cpp.so.15(_ZN5clang17EmitBackendOutputERNS_17DiagnosticsEngineERKNS_19HeaderSearchOptionsERKNS_14CodeGenOptionsERKNS_13TargetOptionsERKNS_11LangOptionsEN4llvm9StringRefEPNSE_6ModuleENS_13BackendActionESt10unique_ptrINSE_17raw_pwrite_streamESt14default_deleteISK_EE+0x1ca5)[0x7f66eff22955]
/usr/lib/llvm-15/bin/../lib/libclang-cpp.so.15(+0x1c828b1)[0x7f66f02828b1]
/usr/lib/llvm-15/bin/../lib/libclang-cpp.so.15(_ZN5clang8ParseASTERNS_4SemaEbb+0x35b)[0x7f66ef08ce9b]
/usr/lib/llvm-15/bin/../lib/libclang-cpp.so.15(_ZN5clang13CodeGenAction13ExecuteActionEv+0xd5)[0x7f66f027e925]
/usr/lib/llvm-15/bin/../lib/libclang-cpp.so.15(_ZN5clang14FrontendAction7ExecuteEv+0x67)[0x7f66f0cb4ea7]
/usr/lib/llvm-15/bin/../lib/libclang-cpp.so.15(_ZN5clang16CompilerInstance13ExecuteActionERNS_14FrontendActionE+0x336)[0x7f66f0c27fb6]
/usr/lib/llvm-15/bin/../lib/libclang-cpp.so.15(_ZN5clang25ExecuteCompilerInvocationEPNS_16CompilerInstanceE+0x29a)[0x7f66f0d32e4a]
/usr/bin/clang++-15(_Z8cc1_mainN4llvm8ArrayRefIPKcEES2_Pv+0x990)[0x55571b8ce9e0]
/usr/bin/clang++-15(+0x11bab)[0x55571b8ccbab]
/usr/lib/llvm-15/bin/../lib/libclang-cpp.so.15(+0x228bbd2)[0x7f66f088bbd2]
/usr/lib/llvm-15/bin/../lib/libLLVM-15.so.1(_ZN4llvm20CrashRecoveryContext9RunSafelyENS_12function_refIFvvEEE+0xde)[0x7f66e84273de]
/usr/lib/llvm-15/bin/../lib/libclang-cpp.so.15(_ZNK5clang6driver10CC1Command7ExecuteEN4llvm8ArrayRefINS2_8OptionalINS2_9StringRefEEEEEPNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEPb+0x138)[0x7f66f088b698]
/usr/lib/llvm-15/bin/../lib/libclang-cpp.so.15(_ZNK5clang6driver11Compilation14ExecuteCommandERKNS0_7CommandERPS3_b+0x44a)[0x7f66f084da8a]
/usr/lib/llvm-15/bin/../lib/libclang-cpp.so.15(_ZNK5clang6driver11Compilation11ExecuteJobsERKNS0_7JobListERN4llvm15SmallVectorImplISt4pairIiPKNS0_7CommandEEEEb+0x8e)[0x7f66f084dcde]
/usr/lib/llvm-15/bin/../lib/libclang-cpp.so.15(_ZN5clang6driver6Driver18ExecuteCompilationERNS0_11CompilationERN4llvm15SmallVectorImplISt4pairIiPKNS0_7CommandEEEE+0x39f)[0x7f66f086ab1f]
/usr/bin/clang++-15(_Z10clang_mainiPPc+0x2c11)[0x55571b8cc311]
/lib/x86_64-linux-gnu/libc.so.6(+0x29d90)[0x7f66e6e29d90]
/lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0x80)[0x7f66e6e29e40]
/usr/bin/clang++-15(_start+0x25)[0x55571b8c93b5]
clang: error: clang frontend command failed with exit code 70 (use -v to see invocation)
Ubuntu clang version 15.0.7
Target: x86_64-pc-linux-gnu
Thread model: posix
InstalledDir: /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: /tmp/example_parallel-da04a3.cpp
clang: note: diagnostic msg: /tmp/example_parallel-da04a3.sh
clang: note: diagnostic msg:
********************
ninja: build stopped: subcommand failed.
```
Preprocessed source and run scripts - https://gist.github.com/SAtacker/efc2d491dac9b71d96d74cea4a92df74
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJzsWU1z2ziT_jX0BSUVAX4ffJAlKtEbf6hMZXY2FxYINiVMSJALgI48v34LBCVHkrM7yWi29vC6XCWpATaebnQ_3QSoUnwrAG6d4M4JFje017tW3mYzTdlXkDdFW77e3lH2VUvKAFFRIi5eWkY1bwVibdNQUTrezHEXjjtzQnf8tz_JslfSIcuCC4csWU3F1iF3Drmb4ABNFh_Xv-ez9fp-NZ9tVk-Pefr7-ul5k70z8jh7SPNFupx9vt843qJ5zXfdPu9ku5W0yTsqaV1DPT64fk6Xq9-_m-4Ec4eQI5q6ZbS2MoQmSpc1LxxvUfOCWXSD0PEW40_ioslTRZVGk8p8TBqqd2jS1PVLgybbui1oPeHKrP_kocnicZHeff6AJp3eSaDlQdtW9G_6HhZo8rBB8wf6FZa8BuWQ5Q-smpbcoIY9bboa3sSs66Ytmjws_76WaYkm7TXAMDSd_mDYhkRFNa0RSNlKx5vZL4gLVJhwGyIJ9YIWNSDdohq2tOZ_AuJCadkzE3NmhkOCKHS8We6QWIW-QxLkeAv0If-82jwt12acnA2TmAtU9eKoI_-C405yoXPNG8glqL7W6o_G_BUOSSzc9X06y1Kk-qLhGlFU9FskoWulNvh2WnfKBD9ZOmS55XrXF1PWNibG6pfDx6ST7R_AtEOWXKl-8O6YSKzuS0B6B4hJqnaDF4ZEc8gcdRI62TJQCkqk2l5asXmSKtUyTjWUSPYCKSZ5p6cWcmYyF5V90x3T0p06brK2O4mo3PYNCK2sJ__fZ-i_E_T_NEGxiRXHm0NbOV6KOioVSEQ1AlGitkIVr8HOJGbmvC0BbUGAHCqCHfHMyHMvBBdb1FGlkEOi5Zh8aG0ED1TQLUiHRKgVqGnLvgYz68foSDQGuP-e9vuRKg4aD6luxhzf_V-yPTpPHfSN613ba6Rem6KtkaANmHViEKqXgF7bHu3oC6Ahwe0ks7qhste2l2g923xErUQK9JDfIF64bIVJPPR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