https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64980

--- Comment #5 from Mikael Morin <mikael at gcc dot gnu.org> ---
(In reply to Mikael Morin from comment #4)
> This cures it:

Another way to cure it:

Index: trans-expr.c
===================================================================
--- trans-expr.c    (révision 220514)
+++ trans-expr.c    (copie de travail)
@@ -3783,10 +3783,6 @@ gfc_apply_interface_mapping_to_expr (gfc_interface
       expr->symtree = sym->new_sym;
     else if (sym->expr)
       gfc_replace_expr (expr, gfc_copy_expr (sym->expr));
-    /* Replace base type for polymorphic arguments.  */
-    if (expr->ref && expr->ref->type == REF_COMPONENT
-        && sym->expr && sym->expr->ts.type == BT_CLASS)
-      expr->ref->u.c.sym = sym->expr->ts.u.derived;
       }

       /* ...and to subexpressions in expr->value.  */

Reply via email to