<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 - Clang should warn when std::isinf is compiled with -ffast-math"
href="https://bugs.llvm.org/show_bug.cgi?id=49212">49212</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>Clang should warn when std::isinf is compiled with -ffast-math
</td>
</tr>
<tr>
<th>Product</th>
<td>clang
</td>
</tr>
<tr>
<th>Version</th>
<td>unspecified
</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>enhancement
</td>
</tr>
<tr>
<th>Priority</th>
<td>P
</td>
</tr>
<tr>
<th>Component</th>
<td>C++
</td>
</tr>
<tr>
<th>Assignee</th>
<td>unassignedclangbugs@nondot.org
</td>
</tr>
<tr>
<th>Reporter</th>
<td>bmoses@google.com
</td>
</tr>
<tr>
<th>CC</th>
<td>blitzrakete@gmail.com, dgregor@apple.com, erik.pilkington@gmail.com, llvm-bugs@lists.llvm.org, richard-llvm@metafoo.co.uk
</td>
</tr></table>
<p>
<div>
<pre>When -ffast-math is enabled, Clang can optimize away calls to std::isinf (and
similar functions such as std::isnan) in ways that may be surprising. As one
of my colleagues said, "I thought -ffast-math only affected stuff like
reordering operations in mathematically-but-not-numerically-equivalent ways and
wouldn't affect stuff like isinf or isnan."
Can we add a warning for the case where std::isinf and similar functions are
invoked in code compiled with -ffast-math?
This warning would also likely have made the confusing interaction of options
in <a class="bz_bug_link
bz_status_NEW "
title="NEW - Clang ignores NANs with -ffast-math and -fhonor-nans (or -fno-finite-math-only)"
href="show_bug.cgi?id=33510">bug 33510</a> immediately obvious, rather than requiring the user to notice that
their NaN handling wasn't working as expected.</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>