<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 - Compiler miscompiling code after r329525 when optimizations are enabled"
href="https://bugs.llvm.org/show_bug.cgi?id=37119">37119</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>Compiler miscompiling code after r329525 when optimizations are enabled
</td>
</tr>
<tr>
<th>Product</th>
<td>new-bugs
</td>
</tr>
<tr>
<th>Version</th>
<td>trunk
</td>
</tr>
<tr>
<th>Hardware</th>
<td>PC
</td>
</tr>
<tr>
<th>OS</th>
<td>Linux
</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>new bugs
</td>
</tr>
<tr>
<th>Assignee</th>
<td>unassignedbugs@nondot.org
</td>
</tr>
<tr>
<th>Reporter</th>
<td>douglas_yung@playstation.sony.com
</td>
</tr>
<tr>
<th>CC</th>
<td>llvm-bugs@lists.llvm.org
</td>
</tr></table>
<p>
<div>
<pre>Created <span class=""><a href="attachment.cgi?id=20186" name="attach_20186" title="repro code">attachment 20186</a> <a href="attachment.cgi?id=20186&action=edit" title="repro code">[details]</a></span>
repro code
One of our internal tests started to fail after r329525 was committed. The test
was automagically generated, so it is a bit messy, but I have cut it down to a
somewhat smaller sample that I am able to reproduce the issue with on linux
independent of our test framework.
To reproduce the problem, build a compiler that is r329525 or newer on x64
linux, and the build/run the attached test with (-O2) and without (-O0)
optimizations and compare the output of the line for id11513.
Steps:
clang++ -O0 repro3.cpp -o repro3.good
clang++ -O2 repro3.cpp -o repro3.bad
Output of produced executables on my machine:
$ ./repro3.good
{BEGIN}
id11095:-33.831909 -33.831909 -33.831909 -33.831909
id11513:0 ffffffff 0 ffffffff 0 ffffffff ffffffff ffffffff ffffffff 0 0 0
ffffffff ffffffff 0 0
{END}
$ ./repro3.bad
{BEGIN}
id11095:-33.831909 -33.831909 -33.831909 -33.831909
id11513:0 0 ffffffff ffffffff 0 ffffffff 0 ffffffff 0 ffffffff 0 0 0 ffffffff 0
0
{END}
Note that in the optimized case (repro3.bad), in id11513, elements 2, 3, 7, 9,
10 and 13 differ from the non-optimized case (repro3.good).</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>