+2011-09-01 Mikael Morin <mikael.morin@sfr.fr>
+
+ PR fortran/50050
+ * resolve.c (gfc_expr_to_initialize): Don't copy rank.
+ Free copied shape. Recalculate shape and rank.
+
2011-04-16 Release Manager
* GCC 4.4.6 released.
for (i = 0; i < ref->u.ar.dimen; i++)
ref->u.ar.start[i] = ref->u.ar.end[i] = ref->u.ar.stride[i] = NULL;
- result->rank = ref->u.ar.dimen;
break;
}
+ if (result->shape != NULL)
+ {
+ for (i = 0; i < result->rank; i++)
+ mpz_clear (result->shape[i]);
+ gfc_free (result->shape);
+ result->shape = NULL;
+ }
+
+ /* Recalculate rank, shape, etc. */
+ gfc_resolve_expr (result);
return result;
}
+2011-09-01 Mikael Morin <mikael.morin@sfr.fr>
+
+ PR fortran/50050
+ * gfortran.dg/alloc_comp_initializer_3.f90: New test.
+ * gfortran.dg/pointer_comp_init.f90: New test.
+
2011-08-19 Tobias Burnus <burnus@net-b.de>
Backport from mainline
--- /dev/null
+! { dg-do compile }
+!
+! PR fortran/50050
+! Out of bound whilst releasing initialization of allocate object
+!
+! Contributed by someone <sigurdkn@gmail.com>
+
+program bug
+ implicit none
+ type foo
+ integer, pointer :: a => null()
+ end type
+ type(foo), dimension(:,:), allocatable :: data
+ allocate(data(1:1,1)) ! This used to lead to an ICE
+end program
--- /dev/null
+! { dg-do compile }
+!
+! PR fortran/50050
+! ICE whilst trying to access NULL shape.
+
+! Reduced from the FoX library http://www1.gly.bris.ac.uk/~walker/FoX/
+! Contributed by Andrew Benson <abenson@its.caltech.edu>
+
+module m_common_attrs
+ implicit none
+
+ type dict_item
+ end type dict_item
+
+ type dict_item_ptr
+ type(dict_item), pointer :: d => null()
+ end type dict_item_ptr
+
+contains
+
+ subroutine add_item_to_dict()
+ type(dict_item_ptr), pointer :: tempList(:)
+ integer :: n
+
+ allocate(tempList(0:n+1))
+ end subroutine add_item_to_dict
+
+end module m_common_attrs
+
+! { dg-final { cleanup-modules "m_common_attrs" } }