<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 - EarlyCSE incorrectly assumes that readonly functions return"
href="https://bugs.llvm.org/show_bug.cgi?id=51668">51668</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>EarlyCSE incorrectly assumes that readonly functions return
</td>
</tr>
<tr>
<th>Product</th>
<td>libraries
</td>
</tr>
<tr>
<th>Version</th>
<td>trunk
</td>
</tr>
<tr>
<th>Hardware</th>
<td>All
</td>
</tr>
<tr>
<th>OS</th>
<td>All
</td>
</tr>
<tr>
<th>Status</th>
<td>NEW
</td>
</tr>
<tr>
<th>Keywords</th>
<td>miscompilation
</td>
</tr>
<tr>
<th>Severity</th>
<td>normal
</td>
</tr>
<tr>
<th>Priority</th>
<td>P
</td>
</tr>
<tr>
<th>Component</th>
<td>Scalar Optimizations
</td>
</tr>
<tr>
<th>Assignee</th>
<td>unassignedbugs@nondot.org
</td>
</tr>
<tr>
<th>Reporter</th>
<td>nunoplopes@sapo.pt
</td>
</tr>
<tr>
<th>CC</th>
<td>alina.sbirlea@gmail.com, florian_hahn@apple.com, gberry@codeaurora.org, llvm-bugs@lists.llvm.org, llvm-dev@redking.me.uk
</td>
</tr></table>
<p>
<div>
<pre>Test: Transforms/EarlyCSE/globalsaa-memoryssa.ll
define void @f3() {
%call1 = call i16 @f1() nowrite nofree
call void @f2()
%call2 = call i16 @f1() nowrite nofree
ret void
}
=>
define void @f3() {
%call1 = call i16 @f1() nowrite nofree
call void @f2()
ret void
}
The second call to @f1() is incorrectly removed. We don't know if it exits, for
example. Function @f2 may change the state read by @f1 and thus the first call
may return and the second exit.
The optimization should be restricted to functions with the 'willreturn'
attribute.</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>