<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 - Wrong code generated by PowerPC MI Peephole Optimization"
   href="https://bugs.llvm.org/show_bug.cgi?id=45232">45232</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Wrong code generated by PowerPC MI Peephole Optimization
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>libraries
          </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>enhancement
          </td>
        </tr>

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

        <tr>
          <th>Component</th>
          <td>Backend: PowerPC
          </td>
        </tr>

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

        <tr>
          <th>Reporter</th>
          <td>carrot@google.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvm-bugs@lists.llvm.org, nemanja.i.ibm@gmail.com
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Created <span class=""><a href="attachment.cgi?id=23249" name="attach_23249" title="test">attachment 23249</a> <a href="attachment.cgi?id=23249&action=edit" title="test">[details]</a></span>
test

In the attached test case, wrong code is generated for function call to

std::nth_element(values.begin(), middle, values.end())

The second parameter should be a pointer to the middle of vector values, but
values.begin() is actually passed in. It looks PowerPC MI Peephole Optimization
generates the wrong instructions.


The test case can be compiled with
llc -mtriple=powerpc64le-grtev4-linux-gnu  test3.ll</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>