<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 - clang 6 generates invalid instruction on ARM64"
   href="https://bugs.llvm.org/show_bug.cgi?id=36707">36707</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>clang 6 generates invalid instruction on ARM64
          </td>
        </tr>

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

        <tr>
          <th>Version</th>
          <td>6.0
          </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>unassignedclangbugs@nondot.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>mikulas@artax.karlin.mff.cuni.cz
          </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=20055" name="attach_20055" title="a file that reproduces the bug">attachment 20055</a> <a href="attachment.cgi?id=20055&action=edit" title="a file that reproduces the bug">[details]</a></span>
a file that reproduces the bug

clang 6.0 generates invalid instruction "fmov h0,wzr". This instruction is
allowed starting with ARMv8.2, but clang generates it even for ARMv8.0. On
ARMv8.0 processor, the instruction causes SIGILL.

This bug is new to clang 6.0, clang 5.0 behaves correctly.

See the attached file and compile it with -O2.

00000000004005c0 <ret0>:
  4005c0:       1ee703e0        fmov    h0, wzr
  4005c4:       d65f03c0        ret

Note that if you compile the file with "-O2 -no-integrated-as", you get this
error:
/tmp/ret-fp16-87b066.s: Assembler messages:
/tmp/ret-fp16-87b066.s:8: Error: selected processor does not support `fmov
h0,wzr'
clang-6.0: error: assembler command failed with exit code 1 (use -v to see
invocation)</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>