<html>
<head>
<base href="https://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 --- - [MSP430] codegen: strange branch instructions"
href="https://llvm.org/bugs/show_bug.cgi?id=27500">27500</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>[MSP430] codegen: strange branch instructions
</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>All
</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: MSP430
</td>
</tr>
<tr>
<th>Assignee</th>
<td>unassignedbugs@nondot.org
</td>
</tr>
<tr>
<th>Reporter</th>
<td>pftbest@gmail.com
</td>
</tr>
<tr>
<th>CC</th>
<td>llvm-bugs@lists.llvm.org
</td>
</tr>
<tr>
<th>Classification</th>
<td>Unclassified
</td>
</tr></table>
<p>
<div>
<pre>Created <span class=""><a href="attachment.cgi?id=16256" name="attach_16256" title="original.ll (does not trigger error)">attachment 16256</a> <a href="attachment.cgi?id=16256&action=edit" title="original.ll (does not trigger error)">[details]</a></span>
original.ll (does not trigger error)
When original.ll is optimized with `opt -O3` then llc generates strange
conditional branch instructions that look like this:
.LBB0_4: ; %if.then26
cmp.b #126, r7
jne 4
br #.LBB0_57
.LBB0_5: ; %cond.end38
mov.w #1, r13
mov.b r7, r6
and.b #63, r6
"jne 4" instruction is then compiled by gcc into "jnz $+6" and in result we are
jumping over "mov.w #1, r13".
steps to reproduce:
$ opt -O3 original.ll -o optimized.bc
$ llc optimized.bc -o optimized.s
$ cat optimized.s | grep 'j.*\t4'
jne 4
jne 4
software versions:
(<a href="http://llvm.org/git/llvm.git">http://llvm.org/git/llvm.git</a> 822155bcb5ae5fc09d4448b862758631c9378a3b)
LLVM (<a href="http://llvm.org/">http://llvm.org/</a>):
LLVM version 3.9.0svn
DEBUG build with assertions.
Built Apr 24 2016 (08:41:34).
Default target: x86_64-apple-darwin15.4.0
Host CPU: haswell</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>