This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [Fortran, RFC patch] Document naming and argument passing convention
- From: Janne Blomqvist <blomqvist dot janne at gmail dot com>
- To: Tobias Burnus <burnus at net-b dot de>
- Cc: gcc patches <gcc-patches at gcc dot gnu dot org>, gfortran <fortran at gcc dot gnu dot org>
- Date: Sat, 30 Mar 2013 23:13:42 +0200
- Subject: Re: [Fortran, RFC patch] Document naming and argument passing convention
- References: <5155E015 dot 6010600 at net-b dot de> <5155E090 dot 8020506 at net-b dot de> <CAO9iq9GMM3s+AmOtngGhFjcObhPCBK4-6YxEuUyQTSyNh5W=QQ at mail dot gmail dot com> <5157421A dot 6060707 at net-b dot de>
On Sat, Mar 30, 2013 at 9:50 PM, Tobias Burnus <burnus@net-b.de> wrote:
> Janne Blomqvist wrote:
>> +For procedures and variables declared in the specification space of a
>> +module, the name is formed by @code{__}, followed by the lower-cased
>> +module name, @code{_MOD_}, and the lower-cased Fortran name. Note that
>> +no underscore is appended.
>>
>> Would it be worth shortly mentioning the various compiler-generated
>> symbols (e.g. vtables)? BTW, did the patch that changes all those to
>> use the "_F" prefix go in, or are we still doing something else?
>
>
> I was thinking of not mentioning the handling of special things like ENTRY,
> alt-returns, compiler-generated virtual tables etc. However, if you think
> that it fits into this chapter, I can add it.
>
> Regarding the _F prefix: Yes, the patch for GFC_PREFIX (_F. or _F$ or _F_)
> went in, but it is (currently) only used to mangle the hidden-length
> variable for the length of deferred-length characters. Actually, we should
> document that one as well.
Hmm, if it's a long laundry list of special cases (ugh.. :( ), then
maybe it's not worth doing..?
>> +Arguments are passed according to the platform ABI. In particular,
>> +complex arguments may not be compatible to a struct with two real
>> +components for the real and imaginary part; and complex values are
>> +returned as result and not by reference.
>>
>> Here it might be worth mentioning that Fortran complex arguments are
>> ABI-wise handled like C99 _Complex types.
>
>
> That was what I tried to imply by the platform ABI: The Fortran complex is
> handled like Ada's Complex and C's _Complex, which (at least on Alpha) is
> different to the struct version. However, if it helps, I can mention C
> (and/or Ada and/or Java and/or C++).
Ah, well, I at least didn't understand that implication, so it might
be useful to clarify it by explicitly mentioning _Complex.
Thanks,
--
Janne Blomqvist