And bugpoint from following the instruction about code generator bugs:
$ cat input.c
int main() {
__uint128_t r;
__builtin_mul_overflow((__int128)-1, 1, &r);
}
$ clang -emit-llvm -c /tmp/input.c -o /tmp/input.bc
$ bugpoint -run-llc /tmp/input.bc
Read input file : '/tmp/input.bc'
*** All input ok
Initializing execution environment: Found llc: /usr/bin/llc
Running the code generator to test for a crash: <llc>
Error running tool:
/usr/bin/llc -o bugpoint-test-program-48f7920.bc-7ab2041.llc.s bugpoint-test-program-48f7920.bc
terminate called after throwing an instance of 'std::logic_error'
what(): basic_string::_M_construct null not valid
PLEASE submit a bug report to https://bugs.llvm.org/ and include the crash backtrace.
Stack dump:
0. Program arguments: /usr/bin/llc -o bugpoint-test-program-48f7920.bc-7ab2041.llc.s bugpoint-test-program-48f7920.bc
1. Running pass 'Function Pass Manager' on module 'bugpoint-test-program-48f7920.bc'.
2. Running pass 'X86 DAG->DAG Instruction Selection' on function '@main'
#​0 0x00007f435c34b793 (/usr/bin/../lib/libLLVM-12.so+0xb49793)
#​1 0x00007f435c348e96 (/usr/bin/../lib/libLLVM-12.so+0xb46e96)
#​2 0x00007f435b45cda0 __restore_rt (/usr/bin/../lib/libc.so.6+0x3cda0)
#​3 0x00007f435b45cd22 raise (/usr/bin/../lib/libc.so.6+0x3cd22)
#​4 0x00007f435b446862 abort (/usr/bin/../lib/libc.so.6+0x26862)
#​5 0x00007f435b685802 __gnu_cxx::__verbose_terminate_handler() (.cold) /build/gcc/src/gcc/libstdc++-v3/libsupc++/vterminate.cc:75:10
#​6 0x00007f435b691c8a __cxxabiv1::__terminate(void (*)()) /build/gcc/src/gcc/libstdc++-v3/libsupc++/eh_terminate.cc:48:15
#​7 0x00007f435b691cf7 (/usr/bin/../lib/libstdc++.so.6+0xa5cf7)
#​8 0x00007f435b691f8e (/usr/bin/../lib/libstdc++.so.6+0xa5f8e)
#​9 0x00007f435b68836c std::__throw_logic_error(char const*) /build/gcc/src/gcc/libstdc++-v3/src/c++11/functexcept.cc:70:5
#​10 0x00007f435cc417c7 llvm::SelectionDAG::getTargetExternalSymbol(char const*, llvm::EVT, unsigned int) (/usr/bin/../lib/libLLVM-12.so+0x143f7c7)
#​11 0x00007f435f1ff4a1 (/usr/bin/../lib/libLLVM-12.so+0x39fd4a1)
#​12 0x00007f435f2b5297 (/usr/bin/../lib/libLLVM-12.so+0x3ab3297)
#​13 0x00007f435cbbb4de llvm::TargetLowering::LowerCallTo(llvm::TargetLowering::CallLoweringInfo&) const (/usr/bin/../lib/libLLVM-12.so+0x13b94de)
#​14 0x00007f435cb20e4d (/usr/bin/../lib/libLLVM-12.so+0x131ee4d)
#​15 0x00007f435cb3473d (/usr/bin/../lib/libLLVM-12.so+0x133273d)
#​16 0x00007f435cb3c115 (/usr/bin/../lib/libLLVM-12.so+0x133a115)
#​17 0x00007f435cb3c901 llvm::SelectionDAG::LegalizeTypes() (/usr/bin/../lib/libLLVM-12.so+0x133a901)
#​18 0x00007f435cc57216 llvm::SelectionDAGISel::CodeGenAndEmitDAG() (/usr/bin/../lib/libLLVM-12.so+0x1455216)
#​19 0x00007f435cc5a082 llvm::SelectionDAGISel::SelectAllBasicBlocks(llvm::Function const&) (/usr/bin/../lib/libLLVM-12.so+0x1458082)
#​20 0x00007f435cc5c8d9 (/usr/bin/../lib/libLLVM-12.so+0x145a8d9)
#​21 0x00007f435f17e38c (/usr/bin/../lib/libLLVM-12.so+0x397c38c)
#​22 0x00007f435c7442a9 llvm::MachineFunctionPass::runOnFunction(llvm::Function&) (/usr/bin/../lib/libLLVM-12.so+0xf422a9)
#​23 0x00007f435c4a7af0 llvm::FPPassManager::runOnFunction(llvm::Function&) (/usr/bin/../lib/libLLVM-12.so+0xca5af0)
#​24 0x00007f435c4a7c5c llvm::FPPassManager::runOnModule(llvm::Module&) (/usr/bin/../lib/libLLVM-12.so+0xca5c5c)
#​25 0x00007f435c4a947a llvm::legacy::PassManagerImpl::run(llvm::Module&) (/usr/bin/../lib/libLLVM-12.so+0xca747a)
#​26 0x000055e0ccf45ec9 (/usr/bin/llc+0x14ec9)
#​27 0x000055e0ccf3e742 main (/usr/bin/llc+0xd742)
#​28 0x00007f435b447b25 __libc_start_main (/usr/bin/../lib/libc.so.6+0x27b25)
#​29 0x000055e0ccf3ed1e _start (/usr/bin/llc+0xdd1e)
*** Debugging code generator crash!
*** Attempting to reduce the number of function attributes in the testcase
<llc><crash>
<llc><crash>
<llc><crash>
<llc><crash>
<llc><crash>
<llc><crash>
<llc><crash>
<llc><crash>
<llc><crash>
<llc><crash>
Checking for crash with changing conditionals to always jump to true: : <llc><crash>
Emitted bitcode to 'bugpoint-reduced-conditionals.bc'
Checking for crash with only these blocks: : <llc><crash>
Emitted bitcode to 'bugpoint-reduced-blocks.bc'
Checking for crash with CFG simplifying: : <llc><crash>
Emitted bitcode to 'bugpoint-reduced-simplifycfg.bc'
Checking for crash with only 9 instructions: <llc><crash>
Checking for crash with only 5 instructions: <llc>
Checking for crash with only 4 instructions: <llc>
Checking for crash with only 7 instructions: <llc>
Checking for crash with only 2 instructions: <llc>
Checking for crash with only 8 instructions: <llc><crash>
Checking for crash with only 4 instructions: <llc>
Checking for crash with only 4 instructions: <llc>
Checking for crash with only 6 instructions: <llc>
Checking for crash with only 2 instructions: <llc>
Checking for crash with only 7 instructions: <llc>
Checking for crash with only 1 instruction: <llc>
Checking for crash with only 7 instructions: <llc><crash>
Checking for crash with only 6 instructions: <llc>
Checking for crash with only 6 instructions: <llc>
Checking for crash with only 6 instructions: <llc><crash>
Checking for crash with only 5 instructions: <llc><crash>
Checking for crash with only 4 instructions: <llc><crash>
Checking for crash with only 3 instructions: <llc>
Checking for crash with only 3 instructions: <llc>
*** Attempting to reduce testcase by deleting instructions: Simplification Level #​1
Checking instruction: %1 = call { i129, i1 } @​llvm.smul.with.overflow.i129(i129 -1, i129 1)<llc>
Checking instruction: %2 = extractvalue { i129, i1 } %1, 0<llc>
Checking instruction: %3 = trunc i129 %2 to i128<llc>
Checking instruction: store i128 %3, i128* undef, align 16<llc>
*** Attempting to reduce testcase by deleting instructions: Simplification Level #​0
Checking instruction: %1 = call { i129, i1 } @​llvm.smul.with.overflow.i129(i129 -1, i129 1)<llc>
Checking instruction: %2 = extractvalue { i129, i1 } %1, 0<llc>
Checking instruction: %3 = trunc i129 %2 to i128<llc>
Checking instruction: store i128 %3, i128* undef, align 16<llc>
Checking for crash with metadata retained from 5 instructions: <llc><crash>
Checking for crash with metadata retained from 3 instructions: <llc><crash>
Checking for crash with metadata retained from 2 instructions: <llc><crash>
Checking for crash with metadata retained from 1 instruction: <llc><crash>
Emitted bitcode to 'bugpoint-reduced-instructions.bc'
*** Attempting to strip the debug info: <llc><crash>
*** Attempting to strip the debug type info: <llc><crash>
*** Attempting to remove named metadata: Checking for crash with only these named metadata nodes: llvm.module.flags llvm.ident: <llc><crash>
Checking for crash with only these named metadata nodes: llvm.ident: <llc><crash>
Checking for crash with only 1 named metadata operand: <llc><crash>
Emitted bitcode to 'bugpoint-reduced-named-md.bc'
*** Attempting to perform final cleanups: <llc><crash>
Emitted bitcode to 'bugpoint-reduced-simplified.bc'
Extended Description
The following source file:
results in:
I attach the files noted above:
And bugpoint from following the instruction about code generator bugs:
Thank You!