Commit 974b8e61 by Steven G. Kargl

re PR fortran/90002 (ICE: free_expr0(): Bad expr type)

2019-06-12  Steven G. Kargl  <kargl@gcc.gnu.org>

	PR fortran/90002
	* array.c (gfc_free_array_spec): When freeing an array-spec, avoid
	an ICE for assumed-shape coarrays 

2019-06-12  Steven G. Kargl  <kargl@gcc.gnu.org>

	PR fortran/90002
	* gfortran.dg/pr90002.f90: New test.

From-SVN: r272201
parent e97bf6bb
2019-06-12 Steven G. Kargl <kargl@gcc.gnu.org>
PR fortran/90002
* array.c (gfc_free_array_spec): When freeing an array-spec, avoid
an ICE for assumed-shape coarrays
2019-06-08 Paul Thomas <pault@gcc.gnu.org> 2019-06-08 Paul Thomas <pault@gcc.gnu.org>
PR fortran/90786 PR fortran/90786
......
...@@ -324,10 +324,22 @@ gfc_free_array_spec (gfc_array_spec *as) ...@@ -324,10 +324,22 @@ gfc_free_array_spec (gfc_array_spec *as)
if (as == NULL) if (as == NULL)
return; return;
for (i = 0; i < as->rank + as->corank; i++) if (as->corank == 0)
{ {
gfc_free_expr (as->lower[i]); for (i = 0; i < as->rank; i++)
gfc_free_expr (as->upper[i]); {
gfc_free_expr (as->lower[i]);
gfc_free_expr (as->upper[i]);
}
}
else
{
int n = as->rank + as->corank - (as->cotype == AS_EXPLICIT ? 1 : 0);
for (i = 0; i < n; i++)
{
gfc_free_expr (as->lower[i]);
gfc_free_expr (as->upper[i]);
}
} }
free (as); free (as);
......
2019-06-12 Steven G. Kargl <kargl@gcc.gnu.org>
PR fortran/90002
* gfortran.dg/pr90002.f90: New test.
2019-06-12 Martin Sebor <msebor@redhat.com> 2019-06-12 Martin Sebor <msebor@redhat.com>
PR middle-end/90676 PR middle-end/90676
......
! { dg-do compile }
! { dg-options "-fcoarray=single" }
! Contributed by Arseny Solokha <asolokha at gmx dot de>
module pc
integer, dimension(1) :: zw[1:1,1:*]
end module pc
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment