Relaxing argument requiremens on SYSTEM_CLOCK
FX
fxcoudert@gmail.com
Fri Jun 6 22:45:00 GMT 2014
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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: patch
Type: application/octet-stream
Size: 8266 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/fortran/attachments/20140606/eab05b82/attachment.obj>
More information about the Fortran
mailing list