From e6524a510041359e35f0a5b6acdfb43cadce7568 Mon Sep 17 00:00:00 2001 From: Tobias Burnus Date: Thu, 29 Oct 2009 16:24:38 +0100 Subject: re PR fortran/41777 (Wrong-code with POINTER-returning GENERIC function) 2009-10-29 Tobias Burnus 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 PR fortran/41777 gfortran.dg/associated_target_3.f90: New testcase. From-SVN: r153706 --- gcc/fortran/check.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) (limited to 'gcc/fortran/check.c') 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 " -- cgit v1.1