Skip to content

[x86] LLVM silently switches to the soft-float ABI if FPU is disabled on hard-float target #111406

@RalfJung

Description

@RalfJung

Here's a godbolt reproducer: https://godbolt.org/z/GGfTEWcPT
This is basically the X86 version of #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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions