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

--- Comment #10 from janus at gcc dot gnu.org 2011-11-02 20:11:01 UTC ---
(In reply to comment #9)
> Apart from the two failures above, the patch in comment 1 also fails on:
> 
> FAIL: gfortran.dg/class_15.f03  -O  (internal compiler error)

The reason for this seems to be some module loading problem: The vtype of 't2'
is loaded from the module alright, while the vtab is not. As a consequence,
sym->value is not set correctly (in 'gfc_find_derived_vtab'). I'm currently not
sure how to fix the underlying problem, but the resulting segfault can be fixed
by:

Index: resolve.c
===================================================================
--- resolve.c   (revision 180780)
+++ resolve.c   (working copy)
@@ -11971,7 +11971,7 @@ resolve_fl_parameter (gfc_symbol *sym)
   /* Make sure the types of derived parameters are consistent.  This
      type checking is deferred until resolution because the type may
      refer to a derived type from the host.  */
-  if (sym->ts.type == BT_DERIVED
+  if (sym->ts.type == BT_DERIVED && sym->value
       && !gfc_compare_types (&sym->ts, &sym->value->ts))
     {
       gfc_error ("Incompatible derived type in PARAMETER at %L",

Reply via email to