From d54e80ce32abdfdbfbc8cd2265091a4187c3efed Mon Sep 17 00:00:00 2001 From: Mikael Morin Date: Thu, 25 Aug 2011 19:10:06 +0000 Subject: re PR fortran/50050 (Internal compiler error free_expr0 at expr.c:3709 via gfc_done_2) 2011-08-25 Mikael Morin PR fortran/50050 * expr.c (gfc_free_shape): Do nothing if shape is NULL. (free_expr0): Remove redundant NULL shape check. * resolve.c (check_host_association): Ditto. * trans-expr.c (gfc_trans_subarray_assign): Assert that shape is non-NULL. * trans-io.c (transfer_array_component): Ditto. 2011-08-25 Mikael Morin PR fortran/50050 * gfortran.dg/pointer_comp_init_1.f90: New test. From-SVN: r178086 --- gcc/fortran/expr.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'gcc/fortran/expr.c') diff --git a/gcc/fortran/expr.c b/gcc/fortran/expr.c index b050b11..3c09a2a 100644 --- a/gcc/fortran/expr.c +++ b/gcc/fortran/expr.c @@ -409,6 +409,9 @@ gfc_clear_shape (mpz_t *shape, int rank) void gfc_free_shape (mpz_t **shape, int rank) { + if (*shape == NULL) + return; + gfc_clear_shape (*shape, rank); free (*shape); *shape = NULL; @@ -490,8 +493,7 @@ free_expr0 (gfc_expr *e) } /* Free a shape array. */ - if (e->shape != NULL) - gfc_free_shape (&e->shape, e->rank); + gfc_free_shape (&e->shape, e->rank); gfc_free_ref_list (e->ref); -- cgit v1.1