[Bug fortran/54285] [F03] Calling a PPC with proc-ptr result

janus at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Fri Aug 17 08:59:00 GMT 2012


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54285

janus at gcc dot gnu.org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |ASSIGNED
   Last reconfirmed|                            |2012-08-17
         AssignedTo|unassigned at gcc dot       |janus at gcc dot gnu.org
                   |gnu.org                     |
     Ever Confirmed|0                           |1

--- Comment #2 from janus at gcc dot gnu.org 2012-08-17 08:59:13 UTC ---
The error message mentioned in comment 1 can be fixed by this additional hunk:


Index: gcc/fortran/expr.c
===================================================================
--- gcc/fortran/expr.c    (revision 190419)
+++ gcc/fortran/expr.c    (working copy)
@@ -3504,8 +3504,16 @@ gfc_check_pointer_assign (gfc_expr *lvalue, gfc_ex
       comp = gfc_get_proc_ptr_comp (rvalue);
       if (comp)
     {
-      s2 = comp->ts.interface;
-      name = comp->name;
+      if (rvalue->expr_type == EXPR_FUNCTION)
+        {
+          s2 = comp->ts.interface->result;
+          name = comp->ts.interface->result->name;
+        }
+      else
+        {
+          s2 = comp->ts.interface;
+          name = comp->name;
+        }
     }
       else if (rvalue->expr_type == EXPR_FUNCTION)
     {



More information about the Gcc-bugs mailing list