aboutsummaryrefslogtreecommitdiff
path: root/gcc/fortran/trans-io.c
diff options
context:
space:
mode:
authorMikael Morin <mikael@gcc.gnu.org>2011-08-22 14:07:30 +0000
committerMikael Morin <mikael@gcc.gnu.org>2011-08-22 14:07:30 +0000
commit7d7212ec2b45c2829dba3bd3319fce109cbe7f01 (patch)
tree8f626837e5907081d030dc5bb5973cb4f7079283 /gcc/fortran/trans-io.c
parent977e83a3edc1a58077e33143ad3cc1f9349d6197 (diff)
downloadgcc-7d7212ec2b45c2829dba3bd3319fce109cbe7f01.zip
gcc-7d7212ec2b45c2829dba3bd3319fce109cbe7f01.tar.gz
gcc-7d7212ec2b45c2829dba3bd3319fce109cbe7f01.tar.bz2
re PR fortran/50050 (Internal compiler error free_expr0 at expr.c:3709 via gfc_done_2)
2011-08-22 Mikael Morin <mikael.morin@gcc.gnu.org> PR fortran/50050 * gfortran.h (gfc_clear_shape, gfc_free_shape): New prototypes. * expr.c (gfc_clear_shape, gfc_free_shape): New functions. (free_expr0): Re-use gfc_free_shape. * trans-expr.c (gfc_trans_subarray_assign): Ditto. * trans-io.c (transfer_array_component): Ditto. * resolve.c (check_host_association): Ditto. (gfc_expr_to_initialize): Don't force the rank value and free the shape after updating the expression. Recalculate shape and rank. (resolve_where_shape): Re-use gfc_clear_shape. * array.c (gfc_array_ref_shape): Ditto. 2011-08-22 Mikael Morin <mikael.morin@gcc.gnu.org> PR fortran/50050 * gfortran.dg/alloc_comp_initializer_3.f90: New test. From-SVN: r177956
Diffstat (limited to 'gcc/fortran/trans-io.c')
-rw-r--r--gcc/fortran/trans-io.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/gcc/fortran/trans-io.c b/gcc/fortran/trans-io.c
index 4e019a3..2ae34d8 100644
--- a/gcc/fortran/trans-io.c
+++ b/gcc/fortran/trans-io.c
@@ -1999,10 +1999,7 @@ transfer_array_component (tree expr, gfc_component * cm, locus * where)
gfc_add_block_to_block (&block, &loop.pre);
gfc_add_block_to_block (&block, &loop.post);
- for (n = 0; n < cm->as->rank; n++)
- mpz_clear (ss->shape[n]);
- free (ss->shape);
-
+ gfc_free_shape (&ss->shape, cm->as->rank);
gfc_cleanup_loop (&loop);
return gfc_finish_block (&block);