[llvm-bugs] [Bug 28482] New: crash at -O3 on x86_64-linux-gnu in 64-bit mode (Assertion `(MOReg != Reg || OtherMI == KillMI) && "Found multiple kills of a register in a basic block"' failed.)

via llvm-bugs llvm-bugs at lists.llvm.org
Sat Jul 9 07:07:22 PDT 2016


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

            Bug ID: 28482
           Summary: crash at -O3 on x86_64-linux-gnu in 64-bit mode
                    (Assertion `(MOReg != Reg || OtherMI == KillMI) &&
                    "Found multiple kills of a register in a basic block"'
                    failed.)
           Product: clang
           Version: trunk
          Hardware: PC
                OS: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: -New Bugs
          Assignee: unassignedclangbugs at nondot.org
          Reporter: chengniansun at gmail.com
                CC: llvm-bugs at lists.llvm.org
    Classification: Unclassified

$ clang-trunk -v
clang version 3.9.0 (trunk 274832)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /usr/local/bin
Found candidate GCC installation: /usr/lib/gcc/i686-linux-gnu/4.9
Found candidate GCC installation: /usr/lib/gcc/i686-linux-gnu/4.9.3
Found candidate GCC installation: /usr/lib/gcc/i686-linux-gnu/5
Found candidate GCC installation: /usr/lib/gcc/i686-linux-gnu/5.3.0
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.4
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.4.7
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.6
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.6.4
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.7
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.7.3
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.8
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.8.5
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.9
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.9.3
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/5
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/5.3.0
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/6
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/6.1.1
Found candidate GCC installation:
/usr/local/bin/../lib/gcc/x86_64-unknown-linux-gnu/4.6.3
Found candidate GCC installation:
/usr/local/bin/../lib/gcc/x86_64-unknown-linux-gnu/4.7.4
Found candidate GCC installation:
/usr/local/bin/../lib/gcc/x86_64-unknown-linux-gnu/4.8.2
Selected GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.9
Candidate multilib: .;@m64
Candidate multilib: 32;@m32
Candidate multilib: x32;@mx32
Selected multilib: .;@m64
$ 
$ clang-trunk -O3 -g small.c
clang-3.9:
/tmp/llvm-builder/llvm-source-trunk/lib/CodeGen/TwoAddressInstructionPass.cpp:942:
bool
{anonymous}::TwoAddressInstructionPass::rescheduleMIBelowKill(llvm::MachineBasicBlock::iterator&,
llvm::MachineBasicBlock::iterator&, unsigned int): Assertion `(MOReg != Reg ||
OtherMI == KillMI) && "Found multiple kills of a register in a basic block"'
failed.
#0 0x0000000001d579f5 llvm::sys::PrintStackTrace(llvm::raw_ostream&)
(/usr/local/clang-trunk/bin/clang-3.9+0x1d579f5)
#1 0x0000000001d55aae llvm::sys::RunSignalHandlers()
(/usr/local/clang-trunk/bin/clang-3.9+0x1d55aae)
#2 0x0000000001d55c10 SignalHandler(int)
(/usr/local/clang-trunk/bin/clang-3.9+0x1d55c10)
#3 0x00007f25b7316340 __restore_rt
(/lib/x86_64-linux-gnu/libpthread.so.0+0x10340)
#4 0x00007f25b6107cc9 gsignal
/build/eglibc-3GlaMS/eglibc-2.19/signal/../nptl/sysdeps/unix/sysv/linux/raise.c:56:0
#5 0x00007f25b610b0d8 abort
/build/eglibc-3GlaMS/eglibc-2.19/stdlib/abort.c:91:0
#6 0x00007f25b6100b86 __assert_fail_base
/build/eglibc-3GlaMS/eglibc-2.19/assert/assert.c:92:0
#7 0x00007f25b6100c32 (/lib/x86_64-linux-gnu/libc.so.6+0x2fc32)
#8 0x000000000183773a (anonymous
namespace)::TwoAddressInstructionPass::rescheduleMIBelowKill(llvm::MachineInstrBundleIterator<llvm::MachineInstr>&,
llvm::MachineInstrBundleIterator<llvm::MachineInstr>&, unsigned int)
(/usr/local/clang-trunk/bin/clang-3.9+0x183773a)
#9 0x0000000001839a97 (anonymous
namespace)::TwoAddressInstructionPass::tryInstructionTransform(llvm::MachineInstrBundleIterator<llvm::MachineInstr>&,
llvm::MachineInstrBundleIterator<llvm::MachineInstr>&, unsigned int, unsigned
int, unsigned int, bool) (/usr/local/clang-trunk/bin/clang-3.9+0x1839a97)
#10 0x000000000183dfc6 (anonymous
namespace)::TwoAddressInstructionPass::runOnMachineFunction(llvm::MachineFunction&)
(/usr/local/clang-trunk/bin/clang-3.9+0x183dfc6)
#11 0x000000000171aa45
llvm::MachineFunctionPass::runOnFunction(llvm::Function&)
(/usr/local/clang-trunk/bin/clang-3.9+0x171aa45)
#12 0x00000000019b9253 llvm::FPPassManager::runOnFunction(llvm::Function&)
(/usr/local/clang-trunk/bin/clang-3.9+0x19b9253)
#13 0x00000000019b985b llvm::legacy::PassManagerImpl::run(llvm::Module&)
(/usr/local/clang-trunk/bin/clang-3.9+0x19b985b)
#14 0x0000000001eb374a clang::EmitBackendOutput(clang::DiagnosticsEngine&,
clang::CodeGenOptions const&, clang::TargetOptions const&, clang::LangOptions
const&, llvm::DataLayout const&, llvm::Module*, clang::BackendAction,
llvm::raw_pwrite_stream*) (/usr/local/clang-trunk/bin/clang-3.9+0x1eb374a)
#15 0x00000000024d799d
clang::BackendConsumer::HandleTranslationUnit(clang::ASTContext&)
(/usr/local/clang-trunk/bin/clang-3.9+0x24d799d)
#16 0x000000000283e37d clang::ParseAST(clang::Sema&, bool, bool)
(/usr/local/clang-trunk/bin/clang-3.9+0x283e37d)
#17 0x00000000024d7cfe clang::CodeGenAction::ExecuteAction()
(/usr/local/clang-trunk/bin/clang-3.9+0x24d7cfe)
#18 0x00000000021e2d6e clang::FrontendAction::Execute()
(/usr/local/clang-trunk/bin/clang-3.9+0x21e2d6e)
#19 0x00000000021b81b6
clang::CompilerInstance::ExecuteAction(clang::FrontendAction&)
(/usr/local/clang-trunk/bin/clang-3.9+0x21b81b6)
#20 0x0000000002270272
clang::ExecuteCompilerInvocation(clang::CompilerInstance*)
(/usr/local/clang-trunk/bin/clang-3.9+0x2270272)
#21 0x0000000000b09678 cc1_main(llvm::ArrayRef<char const*>, char const*,
void*) (/usr/local/clang-trunk/bin/clang-3.9+0xb09678)
#22 0x0000000000ab930c main (/usr/local/clang-trunk/bin/clang-3.9+0xab930c)
#23 0x00007f25b60f2ec5 __libc_start_main
/build/eglibc-3GlaMS/eglibc-2.19/csu/libc-start.c:321:0
#24 0x0000000000b056e4 _start (/usr/local/clang-trunk/bin/clang-3.9+0xb056e4)
Stack dump:
0.      Program arguments: /usr/local/clang-trunk/bin/clang-3.9 -cc1 -triple
x86_64-unknown-linux-gnu -emit-obj -disable-free -main-file-name small.c
-mrelocation-model static -mthread-model posix -fmath-errno -masm-verbose
-mconstructor-aliases -munwind-tables -fuse-init-array -target-cpu x86-64
-momit-leaf-frame-pointer -dwarf-column-info -debug-info-kind=limited
-dwarf-version=4 -debugger-tuning=gdb -resource-dir
/usr/local/clang-trunk/bin/../lib/clang/3.9.0 -internal-isystem
/usr/local/include -internal-isystem
/usr/local/clang-trunk/bin/../lib/clang/3.9.0/include -internal-externc-isystem
/usr/include/x86_64-linux-gnu -internal-externc-isystem /include
-internal-externc-isystem /usr/include -O3 -fdebug-compilation-dir
/data2/c-hunter-results/C/instrument-bugs/REDUCED/20160706-clang-trunk-m64-g-O3-build-025151/delta
-ferror-limit 19 -fmessage-length 236 -fobjc-runtime=gcc
-fdiagnostics-show-option -fcolor-diagnostics -vectorize-loops -vectorize-slp
-o /tmp/small-a7f716.o -x c small.c 
1.      <eof> parser at end of file
2.      Code generation
3.      Running pass 'Function Pass Manager' on module 'small.c'.
4.      Running pass 'Two-Address instruction pass' on function '@main'
clang-3.9: error: unable to execute command: Aborted (core dumped)
clang-3.9: error: clang frontend command failed due to signal (use -v to see
invocation)
clang version 3.9.0 (trunk 274832)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /usr/local/bin
clang-3.9: note: diagnostic msg: PLEASE submit a bug report to
http://llvm.org/bugs/ and include the crash backtrace, preprocessed source, and
associated run script.
clang-3.9: note: diagnostic msg: 
********************

PLEASE ATTACH THE FOLLOWING FILES TO THE BUG REPORT:
Preprocessed source(s) and associated run script(s) are located at:
clang-3.9: note: diagnostic msg: /tmp/small-cf47a3.c
clang-3.9: note: diagnostic msg: /tmp/small-cf47a3.sh
clang-3.9: note: diagnostic msg: 

********************
$ 
$ cat small.c
int a, b, c, e, j, k;
int d[0];
short f, i;
char g, h;
int main() {
  int l, m;
  for (; g; g++) {
    f = 7;
    for (; f >= 0; f--) {
      k = (a > 0 && l > -l) || (a && a < 7 - l);
      m = f ^ (e == l);
      if (4 != l) {
        l--;
        h = d[f * 8 + 1];
        j = c % b;
        i = -l;
        e = i;
      } else
        return f;
    }
  }
  if (m)
    __builtin_printf(0);
  return 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/20160709/679c7ef9/attachment-0001.html>


More information about the llvm-bugs mailing list