This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: Documentation of LTIME
- From: Janne Blomqvist <blomqvist dot janne at gmail dot com>
- To: Janus Weil <janus at gcc dot gnu dot org>
- 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 19:17:11 +0200
- 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>
On Sat, Nov 26, 2016 at 7:03 PM, Janus Weil <janus@gcc.gnu.org> wrote:
> 2016-11-26 17:58 GMT+01:00 Janus Weil <janus@gcc.gnu.org>:
>>>> * possibly add some more cross-links to intrinsic.texi
>>>
>>> Could you please elaborate?
>>
>> I just mean it might be useful to add some more links from LTIME to
>> ITIME, IDATE and DATE_AND_DATE (and back?). They are are all very
>> similar.
>
> Sorry, I meant DATE_AND_TIME here.
>
>
>>> 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.
>
> Cheers,
> Janus
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.
DATE_AND_TIME is different since it's in the current standard and IIRC
is specified to work with any integer kind.
--
Janne Blomqvist