[llvm-bugs] [Bug 44749] New: Assertion `SrcReg && SrcMO.isUse() && "two address instruction invalid"' failed.

via llvm-bugs llvm-bugs at lists.llvm.org
Sat Feb 1 11:30:06 PST 2020


https://bugs.llvm.org/show_bug.cgi?id=44749

            Bug ID: 44749
           Summary: Assertion `SrcReg && SrcMO.isUse() && "two address
                    instruction invalid"' failed.
           Product: clang
           Version: trunk
          Hardware: PC
                OS: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: -New Bugs
          Assignee: unassignedclangbugs at nondot.org
          Reporter: changochen1 at gmail.com
                CC: htmldeveloper at gmail.com, llvm-bugs at lists.llvm.org,
                    neeilans at live.com, richard-llvm at metafoo.co.uk

POC:
---
# 1 "<built-in>"
# 1 "test1.c"
a() { return (calloc + 1 ? 1 : 0) - 100.000000 <= b() ? 1 : 3.140000; }
---


Run script:
---
# Crash reproducer for clang version 11.0.0
(https://github.com/llvm/llvm-project.git
56b7f595d2b402ff177ca42214325c8fdea10fb0)
# Driver args: "-x" "c" "-o" "test" "test1.c"
# Original command:  "/home/rxz226/llvm-project/bld_instru/bin/clang-11" "-cc1"
"-triple" "x86_64-unknown-linux-gnu" "-emit-obj" "-mrelax-all" "-disable-free"
"-main-file-name" "test1.c" "-mrelocation-model" "static" "-mthread-model"
"posix" "-mframe-pointer=all" "-fmath-errno" "-fno-rounding-math"
"-masm-verbose" "-mconstructor-aliases" "-munwind-tables" "-target-cpu"
"x86-64" "-dwarf-column-info" "-fno-split-dwarf-inlining"
"-debugger-tuning=gdb" "-resource-dir"
"/home/rxz226/llvm-project/bld_instru/lib/clang/11.0.0" "-internal-isystem"
"/usr/local/include" "-internal-isystem"
"/home/rxz226/llvm-project/bld_instru/lib/clang/11.0.0/include"
"-internal-externc-isystem" "/usr/include/x86_64-linux-gnu"
"-internal-externc-isystem" "/include" "-internal-externc-isystem"
"/usr/include" "-fdebug-compilation-dir" "/home/rxz226/fuzz_clang4/hangs/test"
"-ferror-limit" "19" "-fmessage-length" "0" "-fgnuc-version=4.2.1"
"-fobjc-runtime=gcc" "-fdiagnostics-show-option" "-fcolor-diagnostics"
"-faddrsig" "-o" "/tmp/test1-faa68f.o" "-x" "c" "test1.c"
 "/home/rxz226/llvm-project/bld_instru/bin/clang-11" "-cc1" "-triple"
"x86_64-unknown-linux-gnu" "-emit-obj" "-mrelax-all" "-disable-free"
"-main-file-name" "test1.c" "-mrelocation-model" "static" "-mthread-model"
"posix" "-mframe-pointer=all" "-fmath-errno" "-fno-rounding-math"
"-masm-verbose" "-mconstructor-aliases" "-munwind-tables" "-target-cpu"
"x86-64" "-dwarf-column-info" "-fno-split-dwarf-inlining"
"-debugger-tuning=gdb" "-ferror-limit" "19" "-fmessage-length" "0"
"-fgnuc-version=4.2.1" "-fobjc-runtime=gcc" "-fdiagnostics-show-option"
"-fcolor-diagnostics" "-faddrsig" "-x" "c" "test1-5d5af5.c"
---

Stack dump:
---
clang:
/home/rxz226/llvm-project/llvm/lib/CodeGen/TwoAddressInstructionPass.cpp:1480:
bool (anonymous
namespace)::TwoAddressInstructionPass::collectTiedOperands(llvm::MachineInstr
*, (anonymous namespace)::TwoAddressInstructionPass::TiedOperandMap &):
Assertion `SrcReg && SrcMO.isUse() && "two address instruction invalid"'
failed.
Stack dump:
0.      Program arguments: /home/rxz226/llvm-project/bld_instru/bin/clang -x c
-o test test1.c
1.      <eof> parser at end of file
2.      Code generation
3.      Running pass 'Function Pass Manager' on module 'test1.c'.
4.      Running pass 'Two-Address instruction pass' on function '@a'
 #0 0x000000000681faf6 llvm::sys::PrintStackTrace(llvm::raw_ostream&)
/home/rxz226/llvm-project/llvm/lib/Support/Unix/Signals.inc:560:7
 #1 0x000000000681ac5e llvm::sys::RunSignalHandlers()
/home/rxz226/llvm-project/llvm/lib/Support/Signals.cpp:69:18
 #2 0x000000000681dd30 llvm::sys::CleanupOnSignal(unsigned long)
/home/rxz226/llvm-project/llvm/lib/Support/Unix/Signals.inc:361:3
 #3 0x000000000662a5aa (anonymous
namespace)::CrashRecoveryContextImpl::HandleCrash(int, unsigned long)
/home/rxz226/llvm-project/llvm/lib/Support/CrashRecoveryContext.cpp:80:5
 #4 0x000000000662a9e6
/home/rxz226/llvm-project/llvm/lib/Support/CrashRecoveryContext.cpp:361:51
 #5 0x00007f8954dad390 __restore_rt
(/lib/x86_64-linux-gnu/libpthread.so.0+0x11390)
 #6 0x00007f8953917428 raise
/build/glibc-LK5gWL/glibc-2.23/signal/../sysdeps/unix/sysv/linux/raise.c:54:0
 #7 0x00007f895391902a abort /build/glibc-LK5gWL/glibc-2.23/stdlib/abort.c:91:0
 #8 0x00007f895390fbd7 __assert_fail_base
/build/glibc-LK5gWL/glibc-2.23/assert/assert.c:92:0
 #9 0x00007f895390fc82 (/lib/x86_64-linux-gnu/libc.so.6+0x2dc82)
#10 0x0000000004cc6b83 llvm::MachineOperand::isKill() const
/home/rxz226/llvm-project/llvm/include/llvm/CodeGen/MachineOperand.h:389:5
#11 0x0000000004cc6b83 (anonymous
namespace)::TwoAddressInstructionPass::eliminateRegSequence(llvm::MachineInstrBundleIterator<llvm::MachineInstr,
false>&)
/home/rxz226/llvm-project/llvm/lib/CodeGen/TwoAddressInstructionPass.cpp:1826:0
#12 0x0000000004cc6b83 (anonymous
namespace)::TwoAddressInstructionPass::runOnMachineFunction(llvm::MachineFunction&)
/home/rxz226/llvm-project/llvm/lib/CodeGen/TwoAddressInstructionPass.cpp:1716:0
#13 0x0000000004775489
llvm::MachineFunctionPass::runOnFunction(llvm::Function&)
/home/rxz226/llvm-project/llvm/lib/CodeGen/MachineFunctionPass.cpp:75:7
#14 0x00000000052a3f93 llvm::FPPassManager::runOnFunction(llvm::Function&)
/home/rxz226/llvm-project/llvm/lib/IR/LegacyPassManager.cpp:1481:27
#15 0x00000000052a4763
llvm::ilist_iterator<llvm::ilist_detail::node_options<llvm::Function, true,
false, void>, false, false>::operator++()
/home/rxz226/llvm-project/llvm/include/llvm/ADT/ilist_iterator.h:0:0
#16 0x00000000052a4763 llvm::FPPassManager::runOnModule(llvm::Module&)
/home/rxz226/llvm-project/llvm/lib/IR/LegacyPassManager.cpp:1516:0
#17 0x00000000052a57c2 (anonymous
namespace)::MPPassManager::runOnModule(llvm::Module&)
/home/rxz226/llvm-project/llvm/lib/IR/LegacyPassManager.cpp:1582:27
#18 0x00000000052a57c2 llvm::legacy::PassManagerImpl::run(llvm::Module&)
/home/rxz226/llvm-project/llvm/lib/IR/LegacyPassManager.cpp:1694:0
#19 0x0000000006eb51a2 llvm::TimeTraceScope::~TimeTraceScope()
/home/rxz226/llvm-project/llvm/include/llvm/Support/TimeProfiler.h:0:0
#20 0x0000000006eb51a2 (anonymous
namespace)::EmitAssemblyHelper::EmitAssembly(clang::BackendAction,
std::unique_ptr<llvm::raw_pwrite_stream,
std::default_delete<llvm::raw_pwrite_stream> >)
/home/rxz226/llvm-project/clang/lib/CodeGen/BackendUtil.cpp:924:0
...
---

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20200201/6162b53f/attachment-0001.html>


More information about the llvm-bugs mailing list