This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug fortran/48059] [4.6 Regression][OOP] ICE in in gfc_conv_component_ref: character function of extended type


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

--- Comment #11 from janus at gcc dot gnu.org 2011-03-11 18:24:01 UTC ---
The patch in comment #8 induced a regression in module_read_2.f90, which is
fixed by the following update (we must only replace the base type, if the
actual argument is polymorphic!):


Index: gcc/fortran/trans-expr.c
===================================================================
--- gcc/fortran/trans-expr.c    (revision 170879)
+++ gcc/fortran/trans-expr.c    (working copy)
@@ -2247,6 +2247,10 @@ 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.  */


In this form the patch is free of testsuite regressions (on
x86_64-unknown-linux-gnu). Ok for trunk?


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]