[gfortran,patch] Fix intrinsics used as actual arguments
FX Coudert
fxcoudert@gmail.com
Sun Oct 1 17:54:00 GMT 2006
Hi all,
Here is the patch I promised: this fixes a few problems related to
the use of intrinsics as actual arguments. It's a bit long, but it's
really straightforward and should be rather easy to review ;-)
I'll try to comment my patch below, please ask if you have any
question. First, there are the general front-end changes:
-- the intrinsics list in intrinsic.c was reviewed and the
actual_ok field was corrected in each case, according to the
Standard. A few GNU intrinsics are kept allowed as actual arguments,
for consistency: ACOSH ATANH DACOSH DASINH DATANH DCONJG DIMAG ZABS
ZCOS ZEXP ZLOG ZSIN ZSQRT; also, no intrinsic subroutine is allowed
as actual argument, so having an actual_ok argument to add_sym_?s
functions is useless; the value of actual_ok is propagated into each
gfc_intrinsic_sym
-- create a new function gfc_intrinsic_actual_ok in intrinsic.c
for the resolution functions to perform checks; it is called in
resolve_actual_arglist (resolve.c) and an error message is issued if
need be; the CHAR intrinsic is special-cased because it's the only
one forbidden (as actual arg) in F95 and allowed in F2003
-- change gfc_get_extern_function_decl in trans-decl.c to call
isym->resolve.f3 when an intrinsic has 3 args
Library changes:
-- make m4 generate new files for AIMAG, ASINH, ACOSH and ATANH
specifics
-- use a new simple m4 file (misc_specifics.m4) to generate code
for other specifics (including character functions)
Smaller changes:
-- a gfc_resolve_index_func function is added to resolve the INDEX
intrinsic, so that it can be used as actual argument (PR 16580)
-- intrinsic.texi is updated to mention that DIMAG is a GNU extension
-- testcases for all this
Bootstrapped & regtested on i686-linux, OK for 4.2?
:ADDPATCH fortran:
-------------- next part --------------
A non-text attachment was scrubbed...
Name: intrinsics.ChangeLog
Type: application/octet-stream
Size: 2973 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/fortran/attachments/20061001/9f7a6dc5/attachment.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: intrinsics.diff
Type: application/octet-stream
Size: 133780 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/fortran/attachments/20061001/9f7a6dc5/attachment-0001.obj>
More information about the Fortran
mailing list