This is the mail archive of the
mailing list for the GCC project.
Re: [patch, fortran] annotate library calls, part 1
- From: Tobias Burnus <burnus at net-b dot de>
- To: Mikael Morin <mikael dot morin at sfr dot fr>
- Cc: Daniel Franke <franke dot daniel at gmail dot com>, fortran at gcc dot gnu dot org, gcc-patches at gcc dot gnu dot org
- Date: Tue, 13 Jul 2010 19:26:45 +0200
- Subject: Re: [patch, fortran] annotate library calls, part 1
- References: <firstname.lastname@example.org> <4BFBDC46.email@example.com> <4C3B2938.firstname.lastname@example.org> <4C3B4038.email@example.com> <4C3C6850.firstname.lastname@example.org> <4C3C9975.email@example.com>
On 07/13/2010 06:51 PM, Mikael Morin wrote:
>> I checked "ctime" and the result looks fine for both subroutine and
>> function version, cf. http://gcc.gnu.org/onlinedocs/gfortran/CTIME.html
>> -- why do you think that the order is reversed?
> >From your patch :
> + gfor_fndecl_ctime = gfc_build_library_function_decl_with_spec (
> + get_identifier (PREFIX("ctime")), ".W",
> + void_type_node, 3, pchar_type_node, gfc_charlen_type_node,
> + gfc_int8_type_node);
> the char (pointer and length) is first, the integer is last.
> >From the documentation :
> call ctime(i,date)
> The integer is first, the char (pointer and length) is last.
>From the documentation:
| CALL CTIME(TIME, RESULT)|
| RESULT = CTIME(TIME)
|From the dump:
_gfortran_ctime_sub (&secs, &date, 100);
_gfortran_ctime (&pstr.0, &len.1, secs);
Thus, the documentation matches (with function result = first argument)
> But you have said that trans-decl.c doesn't handle the subroutine
> version ? I was supposing that both were handled by the same
> subroutine declaration and the front-end was rewriting the function
> version as a subroutine call.
I thought something similar, but as you can see in the dump, two
disjunct procedures are called.