aboutsummaryrefslogtreecommitdiff
path: root/gcc/fortran/resolve.c
diff options
context:
space:
mode:
authorFrancois-Xavier Coudert <fxcoudert@gcc.gnu.org>2008-02-28 15:42:21 +0000
committerFrançois-Xavier Coudert <fxcoudert@gcc.gnu.org>2008-02-28 15:42:21 +0000
commit43e7fd21ac4980fc31c40e76abf3223e2be167f1 (patch)
treea13a53820b1a4fc0ec96de75d9fa6c175f09961a /gcc/fortran/resolve.c
parentcbfb21c1c1e1b9d012f4d67838a88a94b5fb5e24 (diff)
downloadgcc-43e7fd21ac4980fc31c40e76abf3223e2be167f1.zip
gcc-43e7fd21ac4980fc31c40e76abf3223e2be167f1.tar.gz
gcc-43e7fd21ac4980fc31c40e76abf3223e2be167f1.tar.bz2
re PR fortran/34868 (ICE with -ff2c for function returning a complex number)
PR fortran/34868 * trans-expr.c (gfc_conv_variable): Don't build indirect references when explicit interface is mandated. * resolve.c (resolve_formal_arglist): Set attr.always_explicit on the result symbol as well as the procedure symbol. * gfortran.dg/f2c_9.f90: New test. From-SVN: r132751
Diffstat (limited to 'gcc/fortran/resolve.c')
-rw-r--r--gcc/fortran/resolve.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/gcc/fortran/resolve.c b/gcc/fortran/resolve.c
index 3df9791..ead60f2 100644
--- a/gcc/fortran/resolve.c
+++ b/gcc/fortran/resolve.c
@@ -106,7 +106,10 @@ resolve_formal_arglist (gfc_symbol *proc)
if (gfc_elemental (proc)
|| sym->attr.pointer || sym->attr.allocatable
|| (sym->as && sym->as->rank > 0))
- proc->attr.always_explicit = 1;
+ {
+ proc->attr.always_explicit = 1;
+ sym->attr.always_explicit = 1;
+ }
formal_arg_flag = 1;
@@ -187,7 +190,11 @@ resolve_formal_arglist (gfc_symbol *proc)
if ((sym->as && sym->as->rank > 0 && sym->as->type == AS_ASSUMED_SHAPE)
|| sym->attr.pointer || sym->attr.allocatable || sym->attr.target
|| sym->attr.optional)
- proc->attr.always_explicit = 1;
+ {
+ proc->attr.always_explicit = 1;
+ if (proc->result)
+ proc->result->attr.always_explicit = 1;
+ }
/* If the flavor is unknown at this point, it has to be a variable.
A procedure specification would have already set the type. */