<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 --- - llc fails with 'Bad machine code: Using an undefined physical register' when targeting thumb"
href="http://llvm.org/bugs/show_bug.cgi?id=17971">17971</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>llc fails with 'Bad machine code: Using an undefined physical register' when targeting thumb
</td>
</tr>
<tr>
<th>Product</th>
<td>libraries
</td>
</tr>
<tr>
<th>Version</th>
<td>trunk
</td>
</tr>
<tr>
<th>Hardware</th>
<td>PC
</td>
</tr>
<tr>
<th>OS</th>
<td>MacOS X
</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>Backend: ARM
</td>
</tr>
<tr>
<th>Assignee</th>
<td>unassignedbugs@nondot.org
</td>
</tr>
<tr>
<th>Reporter</th>
<td>vargaz@gmail.com
</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=11562" name="attach_11562" title="testcase">attachment 11562</a> <a href="attachment.cgi?id=11562&action=edit" title="testcase">[details]</a></span>
testcase
The attached testcase causes llc to fail with:
<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
*** Bad machine code: Using an undefined physical register ***
- function: FOO
- basic block: BB#0 BB0 (0x7ff91a0023a0)
- instruction: %R0<def,tied1> = t2MOVCCi %R0<kill,tied0>, 1, pred:0,
pred:%CPSR<kill>
- operand 4: %CPSR<kill>
LLVM ERROR: Found 1 machine code errors.
<span class="quote">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>></span >
llc command line:
llc -mtriple=thumbv7-ios -o foo.s bug.bc
llvm version: r194943
The problem seem to be that ARMBaseInstrInfo::optimizeCompareInstr () removes
the instruction defining CPSR, and moves the definition to a previous
instruction, but that instruction is also removed later.</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>