diff mbox

[Fortran] Fix PR 53824

Message ID 5002A8DA.60704@netcologne.de
State New
Headers show

Commit Message

Thomas Koenig July 15, 2012, 11:26 a.m. UTC
Hello world,

this fixes an ICE with allocation of coarrays.  Regression-tested.

OK for trunk?  What about 4.7?

	Thomas

2012-07-15  Thomas König  <tkoenig@gcc.gnu.org>

         PR fortran/53824
         * resolve.c (resolve_allocate_deallocate):  If both
         start indices are NULL, skip the test for equality.

2012-07-15  Thomas König  <tkoenig@gcc.gnu.org>

         PR fortran/53824
         * gfortran.dg/coarray_allocate_1.f90:  New test.

Comments

Tobias Burnus July 15, 2012, 7:43 p.m. UTC | #1
Thomas Koenig wrote:
> this fixes an ICE with allocation of coarrays.  Regression-tested.
> OK for trunk?  What about 4.7?

OK. Thanks for the patch. Regarding 4.7, I don't have a strong opinion. 
Given that it is a simple patch and given that (single-image) coarrays 
work rather well in 4.7, maybe one should.

Tobias

> 2012-07-15 Thomas König  <tkoenig@gcc.gnu.org>
>
>         PR fortran/53824
>         * resolve.c (resolve_allocate_deallocate):  If both
>         start indices are NULL, skip the test for equality.
>
> 2012-07-15  Thomas König  <tkoenig@gcc.gnu.org>
>
>         PR fortran/53824
>         * gfortran.dg/coarray_allocate_1.f90:  New test.
diff mbox

Patch

Index: resolve.c
===================================================================
--- resolve.c	(Revision 189478)
+++ resolve.c	(Arbeitskopie)
@@ -7326,8 +7326,8 @@  resolve_allocate_deallocate (gfc_code *code, const
 	  }
     }
 
-  /* Check that an allocate-object appears only once in the statement.  
-     FIXME: Checking derived types is disabled.  */
+  /* Check that an allocate-object appears only once in the statement.  */
+
   for (p = code->ext.alloc.list; p; p = p->next)
     {
       pe = p->expr;
@@ -7377,9 +7377,10 @@  resolve_allocate_deallocate (gfc_code *code, const
 			{
 			  gfc_array_ref *par = &(pr->u.ar);
 			  gfc_array_ref *qar = &(qr->u.ar);
-			  if (gfc_dep_compare_expr (par->start[0],
-						    qar->start[0]) != 0)
-			      break;
+			  if ((par->start[0] != NULL || qar->start[0] != NULL)
+			      && gfc_dep_compare_expr (par->start[0],
+						       qar->start[0]) != 0)
+			    break;
 			}
 		    }
 		  else