This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: Documentation of LTIME
- From: Janus Weil <janus at gcc dot gnu dot org>
- To: Janne Blomqvist <blomqvist dot janne at gmail dot com>
- Cc: Dominique d'Humières <dominiq at lps dot ens dot fr>, Francisco Pena <fran dot pena at usc dot es>, gfortran <fortran at gcc dot gnu dot org>, gcc-patches <gcc-patches at gcc dot gnu dot org>
- Date: Sat, 26 Nov 2016 18:25:37 +0100
- Subject: Re: Documentation of LTIME
- Authentication-results: sourceware.org; auth=none
- References: <42E6ADCB-E228-42B0-BF2B-E630E56C2048@lps.ens.fr> <CAC2FYYqEPKCNp88Yb7RTJtOZjuU1b-VirROSoCrRQgNwNRgm5Q@mail.gmail.com> <B272C514-F1C7-471E-A650-2E126BF51807@lps.ens.fr> <CAKwh3qjt0FVw7n_RU30Mn1JEPp6sixUVK_OECoE58khe=nCDNQ@mail.gmail.com> <CAKwh3qh8JgA2svLZxF=i6R7EdOZyMGdaikyhgBRTs7LKP3vraQ@mail.gmail.com> <473F4144-7133-4DB3-B7E4-EF7A4EFDF4D6@lps.ens.fr> <CAKwh3qgT9iKVxT=LGbb3Mh2sf0Kc2pZSU45GQ3JSXON3HFQC_Q@mail.gmail.com> <CAKwh3qhf9egrL3V7+5gXZTMcBBVY2yG=bYhOtmnSB5AHfkPGYQ@mail.gmail.com> <CAO9iq9H04KbZJdTdW=1uPBtuNX0dM+QNQah8bq3LgtBTy=HP4g@mail.gmail.com>
>>>> Well LTIME cannot accept both kind(4) and kind(8) arguments. The reference to TIME8 looks like a mistake, isn’t it?
>>>
>>> Huh, in libgfortran I see two versions with different kinds (ltime_i4
>>> and ltime_i8), but in my tests I never get LTIME to work with kind=8
>>> arguments. I guess that is the real bug here ...
>>
>> I think the origin of the bug is:
>>
>> void
>> gfc_resolve_ltime (gfc_code *c)
>> {
>> c->resolved_sym
>> = gfc_get_intrinsic_sub_symbol (gfc_get_string (PREFIX ("ltime_i%d"),
>> gfc_default_integer_kind));
>> }
>>
>>
>> This always uses the ITIME version corresponding to
>> gfc_default_integer_kind, disregarding the actual kind of the
>> arguments.
>
> LTIME, ITIME, TIME, TIME8, IDATE are g77 intrinsics, from back before
> newfangled things like kinds. So there are versions for integer kind=4
> and kind=8 due to -fdefault-integer-8.
Ok, I see. Thanks for the comment.
Still, since we internally already have both implementations for
kind=4 and kind=8, we could as well make use of them, I guess.
If not, we definitely need to fix the documentation of LTIME, since
the current version simply does not work with TIME8(), unless one uses
-fdefault-integer-8 (which is not mentioned in the docu).
Cheers,
Janus