<html>
    <head>
      <base href="https://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 --- - Incorrect code generation of conditional compares for AArch64"
   href="https://llvm.org/bugs/show_bug.cgi?id=24459">24459</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Incorrect code generation of conditional compares for AArch64
          </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>All
          </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>Backend: AArch64
          </td>
        </tr>

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

        <tr>
          <th>Reporter</th>
          <td>kristof.beyls@gmail.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvm-bugs@lists.llvm.org
          </td>
        </tr>

        <tr>
          <th>Classification</th>
          <td>Unclassified
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Created <span class=""><a href="attachment.cgi?id=14725" name="attach_14725" title="reduced test case">attachment 14725</a> <a href="attachment.cgi?id=14725&action=edit" title="reduced test case">[details]</a></span>
reduced test case

It seems that <a href="http://llvm.org/viewvc/llvm-project?view=revision&revision=242436">http://llvm.org/viewvc/llvm-project?view=revision&revision=242436</a>
introduced a correctness regression.
The attached reduced test case (still not tiny though) shows that at
optimization level -O1, this code gets miscompiled, while it still was getting
compiled correctly by clang r242436.

$ ./llvm.org/cmake-build-r242435/bin/clang
./reproducer/aarch64_tree_tests_reduce.c -S -O1 -o ./reproducer/t.242435.s;
$ ./llvm.org/cmake-build-r242436/bin/clang
./reproducer/aarch64_tree_tests_reduce.c -S -O1 -o ./reproducer/t.242436.s;
$ ./llvm.org/cmake-build-r242435/bin/clang
./reproducer/aarch64_tree_tests_reduce.c -O1 -o ./reproducer/t.242435.exe;
$ ./llvm.org/cmake-build-r242436/bin/clang
./reproducer/aarch64_tree_tests_reduce.c -O1 -o ./reproducer/t.242436.exe;
$ ./reproducer/t.242435.exe
$ ./reproducer/t.242436.exe
Expected: 0000000000000000 Got: 0000000000000000</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>