<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 --- - Missed optimization opportunities for pointer comparisons"
href="http://llvm.org/bugs/show_bug.cgi?id=16380">16380</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>Missed optimization opportunities for pointer comparisons
</td>
</tr>
<tr>
<th>Product</th>
<td>clang
</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>Severity</th>
<td>enhancement
</td>
</tr>
<tr>
<th>Priority</th>
<td>P
</td>
</tr>
<tr>
<th>Component</th>
<td>-New Bugs
</td>
</tr>
<tr>
<th>Assignee</th>
<td>unassignedclangbugs@nondot.org
</td>
</tr>
<tr>
<th>Reporter</th>
<td>matthew@dempsky.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>Given "p" as an object of type pointer-to-T and "x" as a complete object of
type T, the C++ standard defines the following expressions must either yield
"false" or an unspecified result:
p < nullptr
nullptr < p
p < &x
&x+1 < p
Thus, the compiler is free to constant fold these expressions to just "false",
and should do so. Similarly, if "a < b" folds to "false" by matching a pattern
above, "b > a" should also fold to "false", and "a >= b" and "b <= a" should
fold to "true".
Currently, Clang only constant folds the first pattern.</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>