This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [patch, fortran] annotate library calls, part 1


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.

Tobias


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]