[llvm-dev] Difference between -mattr=+soft-float and -float-abi=soft

Tim Northover via llvm-dev llvm-dev at lists.llvm.org
Tue Sep 26 02:22:31 PDT 2017

Hi Moritz,

On 26 September 2017 at 09:09, Moritz Angermann via llvm-dev
<llvm-dev at lists.llvm.org> wrote:
> I’ve run into a case where `llc -mattr=+soft-float` for
> "armv7-unknown-linux-androideabi” segfaults, while
> `llc -float-abi=soft` does not.  Similarly if the
> "target-features"="+soft-float” metadata is embedded,
> llc segfaults.

The float-abi option specifies which registers should be used to pass
floating-point values during function calls. The +soft-float option
tells Clang that no floating-point instructions or registers should be
used, so LLVM will make calls to software routines instead of using
the FPU.

In theory they should both be reasonably well tested so a segfault is
slightly surprising. The only idea I can come up with (without source)
is that you've ended up in an inconsistent state: maybe LLVM thinks it
needs to use VFP registers (float-abi=hard) but can't use VFP
instructions to get data there (+soft-float). That wouldn't end well.



More information about the llvm-dev mailing list