This is the mail archive of the
fortran@gcc.gnu.org
mailing list for the GNU Fortran project.
Re: Relaxing argument requiremens on SYSTEM_CLOCK
- From: Janne Blomqvist <blomqvist dot janne at gmail dot com>
- To: FX <fxcoudert at gmail dot com>
- Cc: gfortran <fortran at gcc dot gnu dot org>
- Date: Sun, 15 Jun 2014 07:30:10 +0300
- Subject: Re: Relaxing argument requiremens on SYSTEM_CLOCK
- Authentication-results: sourceware.org; auth=none
- References: <8B5AB16A-FA89-4AFD-BB04-8B1B0D6B9991 at gmail dot com> <22070283-A363-493A-ADAA-51E3C309C9B5 at gmail dot com>
Hi,
in addition to the fixes suggested by Steve, please also update the
documentation. Otherwise it looks Ok. Thanks for the patch!
On Sat, Jun 7, 2014 at 1:45 AM, FX <fxcoudert@gmail.com> wrote:
> Forgot the patch, here it isâ
>
> --------------
>
>> Since Fortran 2003, SYSTEM_CLOCK accepts all kinds (and kind combinations) of integer arguments, as well as real COUNT_RATE arguments. To handle this, and avoid explosion of number of nearly-identical library routines, type conversions need to be handled in the front-end. Iâve followed the approach of keeping the two existing library versions, and picking the best depending on the kinds of arguments passed.
>>
>> The patch attached tries to do so. Itâs my first time writing intrinsic subroutine translation code (in trans-intrinsic.c), and itâs less clean than intrinsic function translationâ so I would really welcome a detailed review of the patch, because I might have messed things slightly, or included unnecessary code. For example, is it really needed to have pairs of gfc_init_se/gfc_conv_expr calls for each of the arguments, for this non-elemental routine? Iâm not sure at all.
>>
>> Anyway, the patch bootstraps and regtests on x86_64-apple-darwin13, and passes a few tests Iâve written. Once I have the approach and code reviewed, Iâll make a formal submission with full testcases and documentation.
>>
>> Thanks in advance.
>> FX
>>
>>
>> PS: by my reading of the standard, itâs not exactly clear that what we currently do, and continue to do with my patch (varying the clock rate returned depending on argument types), is actually allowed
>
--
Janne Blomqvist