aboutsummaryrefslogtreecommitdiff
path: root/gcc/fortran
diff options
context:
space:
mode:
authorPaul Thomas <pault@gcc.gnu.org>2009-07-09 16:48:50 +0000
committerPaul Thomas <pault@gcc.gnu.org>2009-07-09 16:48:50 +0000
commit1aafbf99427843b553de817302453bf126592553 (patch)
treebd61b3a419fdbfb15b0bffd0366af71a7b3f9266 /gcc/fortran
parent6eba227cb539b391ee9c8798284b885e09289914 (diff)
downloadgcc-1aafbf99427843b553de817302453bf126592553.zip
gcc-1aafbf99427843b553de817302453bf126592553.tar.gz
gcc-1aafbf99427843b553de817302453bf126592553.tar.bz2
re PR fortran/40629 (Host association problem)
2008-07-09 Paul Thomas <pault@gcc.gnu.org> PR fortran/40629 * resolve.c (check_host_association): Use the existing accessible symtree and treat function expressions with symbols that have procedure flavor. 2008-07-09 Paul Thomas <pault@gcc.gnu.org> PR fortran/40629 * gfortran.dg/host_assoc_function_9.f90: New test. From-SVN: r149422
Diffstat (limited to 'gcc/fortran')
-rw-r--r--gcc/fortran/ChangeLog7
-rw-r--r--gcc/fortran/resolve.c11
2 files changed, 13 insertions, 5 deletions
diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog
index ceabd60..5b1ed77 100644
--- a/gcc/fortran/ChangeLog
+++ b/gcc/fortran/ChangeLog
@@ -1,3 +1,10 @@
+2008-07-09 Paul Thomas <pault@gcc.gnu.org>
+
+ PR fortran/40629
+ * resolve.c (check_host_association): Use the existing
+ accessible symtree and treat function expressions with
+ symbols that have procedure flavor.
+
2009-07-09 Janus Weil <janus@gcc.gnu.org>
PR fortran/40646
diff --git a/gcc/fortran/resolve.c b/gcc/fortran/resolve.c
index e3aba1a..9b091ad 100644
--- a/gcc/fortran/resolve.c
+++ b/gcc/fortran/resolve.c
@@ -4402,12 +4402,13 @@ check_host_association (gfc_expr *e)
gfc_free (e->shape);
}
- /* Give the symbol a symtree in the right place! */
- gfc_get_sym_tree (sym->name, gfc_current_ns, &st, false);
- st->n.sym = sym;
+ /* Give the expression the right symtree! */
+ gfc_find_sym_tree (e->symtree->name, NULL, 1, &st);
+ gcc_assert (st != NULL);
- if (old_sym->attr.flavor == FL_PROCEDURE)
- {
+ if (old_sym->attr.flavor == FL_PROCEDURE
+ || e->expr_type == EXPR_FUNCTION)
+ {
/* Original was function so point to the new symbol, since
the actual argument list is already attached to the
expression. */