re PR fortran/49540 (Memory-hog with large DATA stmt)
authorJakub Jelinek <jakub@redhat.com>
Thu, 30 Jun 2011 10:25:40 +0000 (12:25 +0200)
committerJakub Jelinek <jakub@gcc.gnu.org>
Thu, 30 Jun 2011 10:25:40 +0000 (12:25 +0200)
commit21ea4922aceb3ffa50c3d00b8d26da6b41af92cf
treef873fddb9973169bde2c078e90368a59e90983c7
parentf7069d58f6b79b685000544981eb4d05d8261bf9
re PR fortran/49540 (Memory-hog with large DATA stmt)

PR fortran/49540
* gfortran.h (gfc_constructor): Add repeat field.
* trans-array.c (gfc_conv_array_initializer): Handle repeat > 1.
* array.c (current_expand): Add repeat field.
(expand_constructor): Copy repeat.
* constructor.c (node_free, node_copy, gfc_constructor_get,
gfc_constructor_lookup): Handle repeat field.
(gfc_constructor_lookup_next, gfc_constructor_remove): New functions.
* data.h (gfc_assign_data_value): Add mpz_t * argument.
(gfc_assign_data_value_range): Removed.
* constructor.h (gfc_constructor_advance): Removed.
(gfc_constructor_lookup_next, gfc_constructor_remove): New prototypes.
* data.c (gfc_assign_data_value): Add REPEAT argument, handle it and
also handle overwriting a range with a single entry.
(gfc_assign_data_value_range): Removed.
* resolve.c (check_data_variable): Adjust gfc_assign_data_value
call.  Use gfc_assign_data_value instead of
gfc_assign_data_value_expr.

* gfortran.dg/pr49540-1.f90: New test.
* gfortran.dg/pr49540-2.f90: New test.

From-SVN: r175693
12 files changed:
gcc/fortran/ChangeLog
gcc/fortran/array.c
gcc/fortran/constructor.c
gcc/fortran/constructor.h
gcc/fortran/data.c
gcc/fortran/data.h
gcc/fortran/gfortran.h
gcc/fortran/resolve.c
gcc/fortran/trans-array.c
gcc/testsuite/ChangeLog
gcc/testsuite/gfortran.dg/pr49540-1.f90 [new file with mode: 0644]
gcc/testsuite/gfortran.dg/pr49540-2.f90 [new file with mode: 0644]