14 Oct 2003 00:40
[gfortran] Functions returning arrays using wrong calling convention
Paul Brook <paul <at> nowt.org>
2003-10-13 22:40:27 GMT
2003-10-13 22:40:27 GMT
We were missing the fact that a function returned an array when resolvind
module procedures. The lead to us using the wrong calling convention.
Patch below applied to tree-ssa branch.
Paul
2003-10-11 Paul Brook <paul <at> nowt.org>
* resolve.c (resolve_formal_arglist): Use function result decl in
preference to function decl.
testsuite
* gfortran.fortran-torture/execute/retarray_2.f90: New test.
--- clean/tree-ssa/gcc/fortran/resolve.c
+++ gcc/gcc/fortran/resolve.c
<at> <at> -60,9 +60,14 <at> <at> resolve_formal_arglist (gfc_symbol * pro
/* TODO: Procedures whose return character length parameter is not
constant
or assumed must also have explicit interfaces. */
+ if (proc->result != NULL)
+ sym = proc->result;
+ else
+ sym = proc;
+
if (gfc_elemental (proc)
- || proc->attr.pointer || proc->attr.allocatable
- || (proc->as && proc->as->rank > 0))
+ || sym->attr.pointer || sym->attr.allocatable
(Continue reading)
RSS Feed