<html>
    <head>
      <base href="http://llvm.org/bugs/" />
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW --- - [AArch64] Assertion `!DefI.atEnd() && "Register has no defs"' in MachineTraceMetrics.cpp"
   href="http://llvm.org/bugs/show_bug.cgi?id=20598">20598</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>[AArch64] Assertion `!DefI.atEnd() && "Register has no defs"' in MachineTraceMetrics.cpp
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>tools
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>trunk
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>PC
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>Linux
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>normal
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>P
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>llc
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>unassignedbugs@nondot.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>apazos@codeaurora.org
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvmbugs@cs.uiuc.edu
          </td>
        </tr>

        <tr>
          <th>Classification</th>
          <td>Unclassified
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Created <span class=""><a href="attachment.cgi?id=12867" name="attach_12867" title="reduced test case">attachment 12867</a> <a href="attachment.cgi?id=12867&action=edit" title="reduced test case">[details]</a></span>
reduced test case

Hi Gerolf and Andy,

r215151 seems to have broken SPEC2000/gcc, SPEC2006/gcc and some other
benchmarks with –O2 –g configuration.

We now hit the assertion:

MachineTraceMetrics.cpp:628: {anonymous}::DataDep::DataDep(const
llvm::MachineRegisterInfo*, unsigned int, unsigned int): Assertion
`!DefI.atEnd() && "Register has no defs"' failed.

Can you reproduce it on your side?

I also tried to reduce a test case, see attachment.

You can reproduce it with this command line:
llc  -O2 -mtriple=aarch64-none-linux-gnu test.ll

Can you please either revert the commit or fix it soon?

/llvm/lib/CodeGen/MachineTraceMetrics.cpp:628:
{anonymous}::DataDep::DataDep(const llvm::MachineRegisterInfo*, unsigned int,
unsigned int): Assertion `!DefI.atEnd() && "Register has no defs"' failed.
0  clang-3.6       0x0000000000f71cd2 llvm::sys::PrintStackTrace(_IO_FILE*) +
34
1  clang-3.6       0x0000000000f718f4
2  libpthread.so.0 0x00002b9547058cb0
3  libc.so.6       0x00002b9547cd7425 gsignal + 53
4  libc.so.6       0x00002b9547cdab8b abort + 379
5  libc.so.6       0x00002b9547cd00ee
6  libc.so.6       0x00002b9547cd0192
7  clang-3.6       0x0000000000a5a5ff
8  clang-3.6       0x0000000000a5ac83
llvm::MachineTraceMetrics::Ensemble::computeInstrDepths(llvm::MachineBasicBlock
const*) + 1507
9  clang-3.6       0x0000000000a60edc
llvm::MachineTraceMetrics::Ensemble::getTrace(llvm::MachineBasicBlock const*) +
28
10 clang-3.6       0x0000000000a1a549
11 clang-3.6       0x0000000000a1bf3b
12 clang-3.6       0x0000000000ca49df
llvm::FPPassManager::runOnFunction(llvm::Function&) + 655
13 clang-3.6       0x0000000000ca4ebb
llvm::FPPassManager::runOnModule(llvm::Module&) + 43
14 clang-3.6       0x0000000000ca51fd
llvm::legacy::PassManagerImpl::run(llvm::Module&) + 797
15 clang-3.6       0x000000000134c1b6
clang::EmitBackendOutput(clang::DiagnosticsEngine&, clang::CodeGenOptions
const&, clang::TargetOptions const&, clang::LangOptions const&,
llvm::StringRef, llvm::Module*, clang::BackendAction, llvm::raw_ostream*) +
3126
16 clang-3.6       0x000000000133f33f
17 clang-3.6       0x00000000017d35b3 clang::ParseAST(clang::Sema&, bool, bool)
+ 483
18 clang-3.6       0x000000000134014b clang::CodeGenAction::ExecuteAction() +
59
19 clang-3.6       0x00000000010dd176 clang::FrontendAction::Execute() + 118
20 clang-3.6       0x00000000010bd920
clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) + 320
21 clang-3.6       0x000000000115fd0e
clang::ExecuteCompilerInvocation(clang::CompilerInstance*) + 2014
22 clang-3.6       0x0000000000678fe8 cc1_main(char const**, char const**, char
const*, void*) + 1064
23 clang-3.6       0x000000000065aab6 main + 8070
24 libc.so.6       0x00002b9547cc276d __libc_start_main + 237
25 clang-3.6       0x0000000000676c35
Stack dump:
0.    Program arguments: clang -O2 -g <edited this line>
1.    <eof> parser at end of file
2.    Code generation
3.    Running pass 'Function Pass Manager' on module 'xxx'.
4.    Running pass 'Machine InstCombiner' on function '@xxx'
clang-3.6: error: unable to execute command: Aborted (core dumped)
clang-3.6: error: clang frontend command failed due to signal (use -v to see
invocation)
clang version 3.6.0 
Target: aarch64--linux-gnu
Thread model: posix
clang-3.6: note: diagnostic msg: PLEASE submit a bug report to
<a href="http://llvm.org/bugs/">http://llvm.org/bugs/</a> and include the crash backtrace, preprocessed source, and
associated run script.
clang-3.6: note: diagnostic msg: 


Thanks!
Ana.</pre>
        </div>
      </p>
      <hr>
      <span>You are receiving this mail because:</span>
      
      <ul>
          <li>You are on the CC list for the bug.</li>
      </ul>
    </body>
</html>