<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 --- - Clang Generates Incorrect Code With Certain Arch and Optimization Combinations"
   href="http://llvm.org/bugs/show_bug.cgi?id=16834">16834</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Clang Generates Incorrect Code With Certain Arch and Optimization Combinations
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>clang
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>trunk
          </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>normal
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>P
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>LLVM Codegen
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>unassignedclangbugs@nondot.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>mathpup@gmail.com
          </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=11007" name="attach_11007" title="Test case">attachment 11007</a> <a href="attachment.cgi?id=11007&action=edit" title="Test case">[details]</a></span>
Test case

With the latest Clang/LLVM from SVN, the sample program abc.cpp produces
incorrect output when compiled with the optimization flags

-O3 -march=corei7-avx -fslp-vectorize -fslp-vectorize-aggressive

The problem goes away if -fslp-vectorize-aggressive is removed, and it also
goes away if -march=corei7-avx.

I am attaching sample C++ source for abc.cpp. I tried to narrow down this test
case, but this seems to be as simple as I can make it while sitting exhibiting
the   problem. The sample program is based on code used in Qt 5 for working
with Bezier curves.

Correct output:
[10, 20], [30, 40], [50, 60], [70, 80]
[10, 20], [20, 30], [30, 40], [40, 50]
[40, 50], [50, 60], [60, 70], [70, 80]

Incorrect output produced as described above:
[10, 20], [30, 40], [50, 60], [70, 80]
[10, 20], [20, 30], [30, 40], [22.5, 50]
[22.5, 50], [45, 60], [60, 70], [70, 80]

I did attempt to use bugpoint, but I could not figure out how to produce any
output that seemed useful.</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>