aboutsummaryrefslogtreecommitdiff
path: root/gcc/fortran/check.c
diff options
context:
space:
mode:
authorTobias Burnus <burnus@net-b.de>2009-10-29 16:24:38 +0100
committerTobias Burnus <burnus@gcc.gnu.org>2009-10-29 16:24:38 +0100
commite6524a510041359e35f0a5b6acdfb43cadce7568 (patch)
treec9e83336694092c16def5c20c43e8d5a89489f2c /gcc/fortran/check.c
parenteb44440252221f3791b513782a492e3a3292c2a4 (diff)
downloadgcc-e6524a510041359e35f0a5b6acdfb43cadce7568.zip
gcc-e6524a510041359e35f0a5b6acdfb43cadce7568.tar.gz
gcc-e6524a510041359e35f0a5b6acdfb43cadce7568.tar.bz2
re PR fortran/41777 (Wrong-code with POINTER-returning GENERIC function)
2009-10-29 Tobias Burnus <burnus@net-b.de> PR fortran/41777 * trans-expr.c * (gfc_conv_procedure_call,gfc_conv_expr_reference): Use for generic EXPR_FUNCTION the attributes of the specific function. 2009-10-29 Tobias Burnus <burnus@net-b.de> PR fortran/41777 gfortran.dg/associated_target_3.f90: New testcase. From-SVN: r153706
Diffstat (limited to 'gcc/fortran/check.c')
-rw-r--r--gcc/fortran/check.c12
1 files changed, 4 insertions, 8 deletions
diff --git a/gcc/fortran/check.c b/gcc/fortran/check.c
index 171eeaa..9b6f8ea 100644
--- a/gcc/fortran/check.c
+++ b/gcc/fortran/check.c
@@ -599,10 +599,8 @@ gfc_check_associated (gfc_expr *pointer, gfc_expr *target)
where = &pointer->where;
- if (pointer->expr_type == EXPR_VARIABLE)
- attr1 = gfc_variable_attr (pointer, NULL);
- else if (pointer->expr_type == EXPR_FUNCTION)
- attr1 = pointer->symtree->n.sym->attr;
+ if (pointer->expr_type == EXPR_VARIABLE || pointer->expr_type == EXPR_FUNCTION)
+ attr1 = gfc_expr_attr (pointer);
else if (pointer->expr_type == EXPR_NULL)
goto null_arg;
else
@@ -624,10 +622,8 @@ gfc_check_associated (gfc_expr *pointer, gfc_expr *target)
if (target->expr_type == EXPR_NULL)
goto null_arg;
- if (target->expr_type == EXPR_VARIABLE)
- attr2 = gfc_variable_attr (target, NULL);
- else if (target->expr_type == EXPR_FUNCTION)
- attr2 = target->symtree->n.sym->attr;
+ if (target->expr_type == EXPR_VARIABLE || target->expr_type == EXPR_FUNCTION)
+ attr2 = gfc_expr_attr (target);
else
{
gfc_error ("'%s' argument of '%s' intrinsic at %L must be a pointer "