<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 --- - x86 code generation miscompilation"
   href="http://llvm.org/bugs/show_bug.cgi?id=21184">21184</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>x86 code generation miscompilation
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>new-bugs
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>unspecified
          </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>karl.tarbe@cyber.ee
          </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>Created <span class=""><a href="attachment.cgi?id=13158" name="attach_13158" title="Program, that misbehaves under x86_64.">attachment 13158</a> <a href="attachment.cgi?id=13158&action=edit" title="Program, that misbehaves under x86_64.">[details]</a></span>
Program, that misbehaves under x86_64.

I have a input file, which is a small program, that prints out some data.
When running on x86_64, without optimizations it produces wrong output.

[karl@funbox bugpoint]$ clang -O0 write.ll -o test && ./test
ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 
ff ff ff ff ff ff ff ff ff 00 00 00 
ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 
ff ff ff ff ff ff ff ff 1f 00 00 00

When using the interpreter it produces correct output.

[karl@funbox bugpoint]$ lli -force-interpreter write.ll 
ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 
ff ff ff ff ff ff ff ff 0f 00 00 00 
ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 
ff ff ff ff ff ff ff ff 1f 00 00 00 

When run on a arm, it also produces correct output.
So I believe that the problem lies in x86 code generation.

Note that bugpoint does manage to reduce somewhat, but I believe the original
code is a better starting point for tracking down this issue.</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>