<html>
    <head>
      <base href="https://bugs.llvm.org/">
    </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 - [X86] Bad machine code: Using an undefined physical register"
   href="https://bugs.llvm.org/show_bug.cgi?id=46827">46827</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>[X86] Bad machine code: Using an undefined physical register
          </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>bharathi.seshadri@gmail.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvm-bugs@lists.llvm.org
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Created <span class=""><a href="attachment.cgi?id=23768" name="attach_23768" title="Test case">attachment 23768</a> <a href="attachment.cgi?id=23768&action=edit" title="Test case">[details]</a></span>
Test case

The failure (crash) was observed when building 32-bit code with LTO (both gold
and lld). The reduced test case and crash logs are included.

$ llc -O2 test.ll

*** Bad machine code: Using an undefined physical register ***
- function:
- basic block: %bb.26  (0x6968630)
- instruction: JCC_1 %bb.72, 5, implicit $eflags
- operand 2:   implicit $eflags
LLVM ERROR: Found 1 machine code errors.
PLEASE submit a bug report to <a href="https://bugs.llvm.org/">https://bugs.llvm.org/</a> and include the crash
backtrace.

Stack dump:
0.      Program arguments: llvm-trunk/build-dbg/bin/llc -O2 test.ll
1.      Running pass 'Function Pass Manager' on module 'test.ll'.
2.      Running pass 'Machine Instruction Scheduler' on function '@0'
 #0 0x0000000003d42c08 llvm::sys::PrintStackTrace(llvm::raw_ostream&)
llvm-trunk/llvm-project/llvm/lib/Support/Unix/Signals.inc:564:22
 #1 0x0000000003d42c9b PrintStackTraceSignalHandler(void*)
llvm-trunk/llvm-project/llvm/lib/Support/Unix/Signals.inc:625:1
 #2 0x0000000003d40d2d llvm::sys::RunSignalHandlers()
llvm-trunk/llvm-project/llvm/lib/Support/Signals.cpp:68:20
 #3 0x0000000003d4264b SignalHandler(int)
llvm-trunk/llvm-project/llvm/lib/Support/Unix/Signals.inc:406:1
 #4 0x0000003a9600f7e0 __restore_rt (/lib64/libpthread.so.0+0x3a9600f7e0)
 #5 0x0000003a958324f5 raise (/lib64/libc.so.6+0x3a958324f5)
 #6 0x0000003a95833cd5 abort (/lib64/libc.so.6+0x3a95833cd5)
 #7 0x0000000003c9f7e7 llvm::install_bad_alloc_error_handler(void (*)(void*,
std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >
const&, bool), void*)
llvm-trunk/llvm-project/llvm/lib/Support/ErrorHandling.cpp:130:61
 #8 0x00000000030bf22a llvm::MachineFunction::verify(llvm::Pass*, char const*,
bool) const llvm-trunk/llvm-project/llvm/lib/CodeGen/MachineVerifier.cpp:312:25
 #9 0x0000000002f38410 llvm::LiveRangeCalc::findReachingDefs(llvm::LiveRange&,
llvm::MachineBasicBlock&, llvm::SlotIndex, unsigned int,
llvm::ArrayRef<llvm::SlotIndex>
) llvm-trunk/llvm-project/llvm/lib/CodeGen/LiveRangeCalc.cpp:225:39
#10 0x0000000002f37a12 llvm::LiveRangeCalc::extend(llvm::LiveRange&,
llvm::SlotIndex, unsigned int, llvm::ArrayRef<llvm::SlotIndex>)
llvm-trunk/llvm-project/llvm/lib/C
odeGen/LiveRangeCalc.cpp:107:23
#11 0x0000000002f3c123 llvm::LiveIntervalCalc::extendToUses(llvm::LiveRange&,
llvm::Register, llvm::LaneBitmask, llvm::LiveInterval*)
llvm-trunk/llvm-project/llvm/lib/
CodeGen/LiveIntervalCalc.cpp:203:11
#12 0x0000000002f234ad llvm::LiveIntervalCalc::extendToUses(llvm::LiveRange&,
llvm::MCRegister)
llvm-trunk/llvm-project/llvm/include/llvm/CodeGen/LiveIntervalCalc.h:56
:3
#13 0x0000000002f1e178
llvm::LiveIntervals::computeRegUnitRange(llvm::LiveRange&, unsigned int)
llvm-trunk/llvm-project/llvm/lib/CodeGen/LiveIntervals.cpp:298:29#14
0x0000000001a2c3db llvm::LiveIntervals::getRegUnit(unsigned int)
llvm-trunk/llvm-project/llvm/include/llvm/CodeGen/LiveIntervals.h:402:15
#15 0x0000000002f23a92 llvm::LiveIntervals::HMEditor::getRegUnitLI(unsigned
int) llvm-trunk/llvm-project/llvm/lib/CodeGen/LiveIntervals.cpp:975:34#16
0x0000000002f23f84
llvm::LiveIntervals::HMEditor::updateAllRanges(llvm::MachineInstr*)
llvm-trunk/llvm-project/llvm/lib/CodeGen/LiveIntervals.cpp:1034:41
#17 0x0000000002f217a2 llvm::LiveIntervals::handleMove(llvm::MachineInstr&,
bool) llvm-trunk/llvm-project/llvm/lib/CodeGen/LiveIntervals.cpp:1491:66#18
0x0000000003080d1d llvm::ScheduleDAGMI::moveInstruction(llvm::MachineInstr*,
llvm::MachineInstrBundleIterator<llvm::MachineInstr, false>)
llvm-trunk/llvm-project/l
lvm/lib/CodeGen/MachineScheduler.cpp:730:7#19 0x0000000003084e91
llvm::ScheduleDAGMILive::scheduleMI(llvm::SUnit*, bool)
llvm-trunk/llvm-project/llvm/lib/CodeGen/MachineScheduler.cpp:1434:21
#20 0x0000000003083e07 llvm::ScheduleDAGMILive::schedule()
llvm-trunk/llvm-project/llvm/lib/CodeGen/MachineScheduler.cpp:1232:9#21
0x000000000308051e (anonymous
namespace)::MachineSchedulerBase::scheduleRegions(llvm::ScheduleDAGInstrs&,
bool) llvm-trunk/llvm-project/llvm/lib/CodeGen/MachineSch
eduler.cpp:582:28#22 0x000000000307f8c6 (anonymous
namespace)::MachineScheduler::runOnMachineFunction(llvm::MachineFunction&)
llvm-trunk/llvm-project/llvm/lib/CodeGen/MachineScheduler.
cpp:394:3#23 0x0000000002fd7348
llvm::MachineFunctionPass::runOnFunction(llvm::Function&)
llvm-trunk/llvm-project/llvm/lib/CodeGen/MachineFunctionPass.cpp:73:33
#24 0x000000000349c109 llvm::FPPassManager::runOnFunction(llvm::Function&)
llvm-trunk/llvm-project/llvm/lib/IR/LegacyPassManager.cpp:1516:20
#25 0x000000000349c358 llvm::FPPassManager::runOnModule(llvm::Module&)
llvm-trunk/llvm-project/llvm/lib/IR/LegacyPassManager.cpp:1552:13#26
0x000000000349c740 (anonymous
namespace)::MPPassManager::runOnModule(llvm::Module&)
llvm-trunk/llvm-project/llvm/lib/IR/LegacyPassManager.cpp:1617:20
#27 0x0000000003497d81 llvm::legacy::PassManagerImpl::run(llvm::Module&)
llvm-trunk/llvm-project/llvm/lib/IR/LegacyPassManager.cpp:614:13#28
0x000000000349cf17 llvm::legacy::PassManager::run(llvm::Module&)
llvm-trunk/llvm-project/llvm/lib/IR/LegacyPassManager.cpp:1738:1
#28 0x000000000349cf17 llvm::legacy::PassManager::run(llvm::Module&)
llvm-trunk/llvm-project/llvm/lib/IR/LegacyPassManager.cpp:1738:1
#29 0x0000000001382387 compileModule(char**, llvm::LLVMContext&)
llvm-trunk/llvm-project/llvm/tools/llc/llc.cpp:653:66
#30 0x0000000001380385 main
llvm-trunk/llvm-project/llvm/tools/llc/llc.cpp:360:35
#31 0x0000003a9581ed20 __libc_start_main (/lib64/libc.so.6+0x3a9581ed20)
#32 0x000000000137f659 _start (llvm-trunk/build-dbg/bin/llc+0x137f659)</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>