Hi all,

here is a small patch fixing a recent OOP regression. It feels a bit
like it's only fixing the effect instead of the cause (since I haven't
really found the cause). But anyway, it does fix the ICE and it is
obvious enough so that I'll commit it by Sunday if no one protests in
the meantime.

Regtested on x86_64-unknown-linux-gnu.

Cheers,
Janus


2011-09-01  Janus Weil  <ja...@gcc.gnu.org>

        PR fortran/50227
        * trans-types.c (gfc_sym_type): Check for proc_name.

2011-09-01  Janus Weil  <ja...@gcc.gnu.org>

        PR fortran/50227
        * gfortran.dg/class_45a.f03: New.
        * gfortran.dg/class_45b.f03: New.
Index: gcc/fortran/trans-types.c
===================================================================
--- gcc/fortran/trans-types.c	(revision 178408)
+++ gcc/fortran/trans-types.c	(working copy)
@@ -2109,7 +2109,8 @@ gfc_sym_type (gfc_symbol * sym)
     {
       /* We must use pointer types for potentially absent variables.  The
 	 optimizers assume a reference type argument is never NULL.  */
-      if (sym->attr.optional || sym->ns->proc_name->attr.entry_master)
+      if (sym->attr.optional
+	  || (sym->ns->proc_name && sym->ns->proc_name->attr.entry_master))
 	type = build_pointer_type (type);
       else
 	{

Attachment: class_45a.f03
Description: Binary data

Attachment: class_45b.f03
Description: Binary data

Reply via email to