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

    <tr>
        <th>Summary</th>
        <td>
            [x86] LLVM silently switches to the soft-float ABI if FPU is disabled on hard-float target
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
      </td>
    </tr>

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

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

<pre>
    Here's a godbolt reproducer: https://godbolt.org/z/GGfTEWcPT
This is basically the X86 version of https://github.com/llvm/llvm-project/issues/110383.

`-mno-sse -mno-x87` switches to the softfloat ABI. I would expect this to *only* happen when I set `-msoft-float`. (Though strangely, that flag on its own does not seem to change the ABI at all?)

Strangely, passing *just* `-mno-sse` to clang behaves as expected: it shows an error. But adding `-mno-x87` (which does not seem to exist for GCC) makes the error go away.

I am a Rust person so I care mostly about the behavior of the backend here, and less about the clang frontend. The underlying issue is that if Rust sets `-x87` for the target features in `createTargetMachine` we should get an error since the registers for the ABI are missing; `+soft-float,-x87` should work because we requested soft-float and then it's fine for the registers to be missing.
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJykVE2T4jYQ_TXi0jWULQM2Bx9gNkxI7VZtbcjHVbbalnaERNTtYcivT0kwM-TjlgvYZfXr9_q9liKyo0dsxXIrlp9mamITYvtNueGnyY-zLuhL-yNGFLImUDAG3QXHEPEUg556jKLagGE-kag2Qu6E3N3OzEMchdz9KeTu6Wk4_PBb__Ugik-i2ByMJbAEnSLbK-cuwAbh92YFLxjJBg9h-CemZTN18z4chdw59_L293CK4Tv2LOTOEk1IQu7Ksqiaan7tdftdFQ9HHx6IEPLDa1OLVQF0ttwbJOCQOVAYeHBBMWy2-zns4RwmpwFfT9gzcOLNAYTcBO8uQm7AqNMJPZwNetgDIUNulXAeMpBYFXMQsjmYMI0GiKPyI6biR2CjGAanRggeLBOEswcdkMAHBkI8pm69SRWZ3ma7B8WgnBPVTsj1vcSf75FPyVc_JqbfJ-LE9G4ESXkCdsqP0KFRL0ig6CYTdbLUMpAJZwLlAWMMcQ7biUFpnXFvYLcxCtmcje3Nv8njqyWGIUR4enwUcg1H9ZzGbfCKCmMAdVaXv7m1B3UEBd8mYjhhpOCBAuyhVxHhGIjdBVQXJs44WYANMYUmv6v-Gb0Gk1P7CMprcEh0V3JVPsTgGb2ew8EgTF5jdJekLicpBTQbZIcrE0KmLPwmOolKYKziiAwDKp4iElifTvURFeMhf_uiemN9HvsZ01hTplLN22yBrO-vFkccLTFGesfPpifhNnsqqm3CF3J7FzL5-J7oK_o5xGfosFcTYWoa8Y8JiVHDR1WeDKfkWs7rPViP720_iHCA7r39fKbbSq-rtZphW9ayqWRRr5uZabUairKUVdfVQ7XscD101TA0dVWslkO9KGe2lYVclEVRl3Wxqpp5V1e9Wi765XJdlLqoxaLAo7JunjY7XR-z7ERbluWiWM2c6tDR200V27z_3TSSWBTOEtNHHVt2-U57bVZi-Qk-f_71C5B16FN2_mvrH97XPhm--_pL8l9bUp1DnfbTqKhvh66Oz6bo2v9zS2VRL638KwAA__8ke9PB">