<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 - Alias analysis fails on aliased function arguments -- possibly resulting in incorrect code after scheduling"
   href="https://bugs.llvm.org/show_bug.cgi?id=38529">38529</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Alias analysis fails on aliased function arguments -- possibly resulting in incorrect code after scheduling
          </td>
        </tr>

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

        <tr>
          <th>Version</th>
          <td>6.0
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>Other
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>All
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>release blocker
          </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>ruttenberg@reservoir.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=20679" name="attach_20679" title="C program example">attachment 20679</a> <a href="attachment.cgi?id=20679&action=edit" title="C program example">[details]</a></span>
C program example

Attached in an example program (taken from the gcc test suite).  Note that the
order fo the stores to pi and pl must happen in order because the argument to f
may alias, and in fact in this example they do.  So the machine scheduler will
need a DAG edge from the store to pi to the store to pl.

To see the problem, we need a target that schedules with alias analysis
enabled.  Arm64 cortex-53 is one example of this.  So compile with:

    clang --target=aarch64-arm-none-eabi -mcpu=cortex-a53  -O2 -S store-store.c
-mllvm -debug-only=isel -mllvm -view-misched-dags

I have attached the dot file for the function f that this generates. Note the
lack of an edge from between the STRX and the STRW.  I have also attached the
result store-store.s.  The code generated is clearly wrong.  It performs the
stores in the wrong order and returns 1 instead of 0.</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>