diff mbox

[Fortran,OOP] PR 50227: [4.7 Regression] ICE-on-valid with allocatable class variable

Message ID CAKwh3qhFZJR7SuT=jcamdavM0KCfSm8i714AGmyU830nKOy4FA@mail.gmail.com
State New
Headers show

Commit Message

Janus Weil Sept. 1, 2011, 8:47 p.m. UTC
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  <janus@gcc.gnu.org>

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

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

	PR fortran/50227
	* gfortran.dg/class_45a.f03: New.
	* gfortran.dg/class_45b.f03: New.

Comments

Janus Weil Sept. 4, 2011, 10:51 a.m. UTC | #1
Committed as r178509.

Cheers,
Janus



2011/9/1 Janus Weil <janus@gcc.gnu.org>:
> 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  <janus@gcc.gnu.org>
>
>        PR fortran/50227
>        * trans-types.c (gfc_sym_type): Check for proc_name.
>
> 2011-09-01  Janus Weil  <janus@gcc.gnu.org>
>
>        PR fortran/50227
>        * gfortran.dg/class_45a.f03: New.
>        * gfortran.dg/class_45b.f03: New.
>
H.J. Lu Sept. 4, 2011, 6:49 p.m. UTC | #2
On Sun, Sep 4, 2011 at 3:51 AM, Janus Weil <janus@gcc.gnu.org> wrote:
> Committed as r178509.
>
> Cheers,
> Janus
>
>
>
> 2011/9/1 Janus Weil <janus@gcc.gnu.org>:
>> 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  <janus@gcc.gnu.org>
>>
>>        PR fortran/50227
>>        * trans-types.c (gfc_sym_type): Check for proc_name.
>>
>> 2011-09-01  Janus Weil  <janus@gcc.gnu.org>
>>
>>        PR fortran/50227
>>        * gfortran.dg/class_45a.f03: New.
>>        * gfortran.dg/class_45b.f03: New.
>>
>

It caused:

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50288
diff mbox

Patch

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
 	{