aboutsummaryrefslogtreecommitdiff
path: root/gcc/fortran/trans-expr.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/trans-expr.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/trans-expr.c')
-rw-r--r--gcc/fortran/trans-expr.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/gcc/fortran/trans-expr.c b/gcc/fortran/trans-expr.c
index 471f168..a348451 100644
--- a/gcc/fortran/trans-expr.c
+++ b/gcc/fortran/trans-expr.c
@@ -513,7 +513,8 @@ gfc_conv_variable (gfc_se * se, gfc_expr * expr)
/* Dereference scalar hidden result. */
if (gfc_option.flag_f2c && sym->ts.type == BT_COMPLEX
&& (sym->attr.function || sym->attr.result)
- && !sym->attr.dimension && !sym->attr.pointer)
+ && !sym->attr.dimension && !sym->attr.pointer
+ && !sym->attr.always_explicit)
se->expr = build_fold_indirect_ref (se->expr);
/* Dereference non-character pointer variables.