<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 - -Ofast produces infinite loop"
href="https://bugs.llvm.org/show_bug.cgi?id=42047">42047</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>-Ofast produces infinite loop
</td>
</tr>
<tr>
<th>Product</th>
<td>new-bugs
</td>
</tr>
<tr>
<th>Version</th>
<td>unspecified
</td>
</tr>
<tr>
<th>Hardware</th>
<td>Macintosh
</td>
</tr>
<tr>
<th>OS</th>
<td>MacOS X
</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>unassignedbugs@nondot.org
</td>
</tr>
<tr>
<th>Reporter</th>
<td>p.riebold@ucl.ac.uk
</td>
</tr>
<tr>
<th>CC</th>
<td>htmldeveloper@gmail.com, llvm-bugs@lists.llvm.org
</td>
</tr></table>
<p>
<div>
<pre>Created <span class=""><a href="attachment.cgi?id=22031" name="attach_22031" title="Minimal file demonstrating optimiser bug ?">attachment 22031</a> <a href="attachment.cgi?id=22031&action=edit" title="Minimal file demonstrating optimiser bug ?">[details]</a></span>
Minimal file demonstrating optimiser bug ?
The attached program should list the powers of 3 less than 2^31 - 1
If compiled with 'cc -o oe oe.c' when run it works as expected however if
compiled with '-Ofast' added it seems as if the 'if ... break;' is ignored and
it enters an infinite loop.
Platform is Mojave 10.14.5, 2.5 GHz Intel Core i7 and cc version,
philip$ cc --version
Apple LLVM version 10.0.1 (clang-1001.0.46.4)
Target: x86_64-apple-darwin18.6.0
Thread model: posix
InstalledDir:
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin
philip$
I'm not a language lawyer so this may be allowed behaviour but thought I should
report it in case it isn't
Philip</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>