[Bug target/82717] [RISCV] Default value of the -mabi option doesn't match documentation
andrew at sifive dot com
gcc-bugzilla@gcc.gnu.org
Wed Oct 25 20:17:00 GMT 2017
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82717
--- Comment #3 from Andrew Waterman <andrew at sifive dot com> ---
On Wed, Oct 25, 2017 at 12:27 PM, asb at lowrisc dot org
<gcc-bugzilla@gcc.gnu.org> wrote:
> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82717
>
> --- Comment #2 from Alex Bradbury <asb at lowrisc dot org> ---
> (In reply to palmer from comment #1)
>> Thanks Alex -- you're correct that this is a documentation/code mismatch. I
>> just talked to Andrew and we think it's best to change the documentation.
>> How does this sound:
>>
>> """
>> @item -mabi=@var{ABI-string}
>> @opindex mabi
>> Specify integer and floating-point calling convention. The default for this
>> argument is system dependent, users who want a specific calling convention
>> should specify one explicitly. The valid calling conventions are: ilp32,
>> ilp32f, ilp32d, lp64, lp64f, and lp64d.
>> """
>
> I can see how a doc fix probably makes most sense at this point, as the
> behaviour has been shipping in GCC for a while. Although I like the idea of
> less typing it could be that inferring a default ABI from the target -march was
> a little too magic in the first place.
I think so. The desired mapping from ISA to ABI depends on the
platform (e.g., -march=rv32imaf should probably use the ilp32 ABI on a
Linux system because the standard libraries will be ilp32, but
probably should use the ilp32f ABI on an embedded system). While we
could define platform-specific mappings from -march to -mabi, things
would get confusing quickly. Better, IMO, to specify -mabi
explicitly.
And of course this is mostly only a headache for cross-compilation;
most native compilations will pass neither -mabi nor -march
explicitly.
>
> I'd also suggest adding another sentence or two to explain that ilp32 and lp64
> describe soft-float calling conventions, while the f and d suffixes indicate
> hard single or double precision floating point calling conventions.
More information about the Gcc-bugs
mailing list