<table border="1" cellspacing="0" cellpadding="8">
    <tr>
        <th>Issue</th>
        <td>
            <a href=https://github.com/llvm/llvm-project/issues/61991>61991</a>
        </td>
    </tr>

    <tr>
        <th>Summary</th>
        <td>
            Spurious errors emitted for global-scope asm with ThinLTO
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            new issue
      </td>
    </tr>

    <tr>
      <th>Assignees</th>
      <td>
      </td>
    </tr>

    <tr>
      <th>Reporter</th>
      <td>
          Amanieu
      </td>
    </tr>
</table>

<pre>
    ### test.c

```c
asm("fld f0, 0(sp)");
```

### Output

```
$ clang test.c -c -target riscv64-unknown-linux-gnu -flto=thin
error: instruction requires the following: 'D' (Double-Precision Floating-Point)
fld f0, 0(sp)
^
error: instruction requires the following: 'D' (Double-Precision Floating-Point)
fld f0, 0(sp)
^
```

The D feature is enabled by default on `riscv64-unknown-linux-gnu`, so this error should normally not be emitted.

However compilation still completes successfully (exit code 0) and produces valid LLVM bitcode in `test.o`.

Similar bug in rustc: https://github.com/rust-lang/rust/issues/80608
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJzMU81u8zYQfBrqspBBUz-WDjo4cY0eUiRAgt4paiWxpUiVXNrJ2xeUnbYp0p4_gKANanZmZ5aUIejJInasemDVKZORZue74yKtxpj1bvjomChuCwgD7RTjJ8aP973mt3U_lWFhomFCjGaAkTPxCJyJJqxMtEyItBcP_yr9wveX1nOkNdK3Wp_QEpSRdrq3BbmCnKSfkMDroC51mUf7u3VXmxtt43s-2Qj5aMix4kSztjce9N55VhxB20A-KtLOgsc_ovYYgGaE0RnjrtpOCcXE4cTEAZhoTi72BvMXj0qHVHU2TpK2U_7itKVkdlP4LoubheqnH6eHb-fxNiOcYERJ0SPoAGhlb3CA_gMGHGU0BM4Cq_l_Rp4YxSMEBzQngmQVwuyiGcA6v0hjPsA6gh4BF02Ew-6fLfzsrnhBD8otqzZyiyaQNmY7MUgYIESlMIQxJi4mGnzXBMoNmNy2IO0Aq3dDVBjgIo0e4Onp11-g17SB9OZgu0aO1fyL_KtetJEe-jglnI-BVJrBTLQGVhyZODNxnjTNsd8ptzBxTpg83cz7fybOOoSIgYlzw2veZENXDG3Rygy7fd3wRhRNU2VzV9dlJcpW8LFt1EE2PS_7cSwKVQztyGue6U5wUfCS16Io9qLaFYdKyEa1h2FQqu8VKzkuUpudMZdl5_yUbdJdvW_bfWZkjyZsj10Ii1fYPqaHWZ0y36WavI9TYCU3OlD4m4U0Gexe1-i1i_cphs95weg8TMb10uRBuRVBhgWummZ4m7V9envOojfd_0SWdO4_-erdb6i-pLZ1_2cAAAD__-u0cno">