diff options
author | Paul Thomas <pault@gcc.gnu.org> | 2012-01-27 10:05:56 +0000 |
---|---|---|
committer | Paul Thomas <pault@gcc.gnu.org> | 2012-01-27 10:05:56 +0000 |
commit | 4daa71b06377971c08341ff1664438de55dd5603 (patch) | |
tree | 2f2b76a32e0f1e1dd26a98bf3470caf96f4b01eb /gcc/fortran/trans-array.h | |
parent | 46c91e45189f62bc959245d9ca5d40f44a65ac82 (diff) | |
download | gcc-4daa71b06377971c08341ff1664438de55dd5603.zip gcc-4daa71b06377971c08341ff1664438de55dd5603.tar.gz gcc-4daa71b06377971c08341ff1664438de55dd5603.tar.bz2 |
re PR fortran/48705 ([OOP] ALLOCATE with non-trivial SOURCE)
2012-01-27 Paul Thomas <pault@gcc.gnu.org>
Tobias Burnus <burnus@gcc.gnu.org>
PR fortran/48705
PR fortran/51870
PR fortran/51943
PR fortran/51946
* trans-array.c (gfc_array_init_size): Add two extra arguments
to convey the dynamic element size of a calls object and to
return the number of elements that have been allocated.
(gfc_array_allocate): Add the same arguments and use them to
call gfc_array_init_size. Before the allocation dereference
the data pointer, if necessary. Set the allocated array to zero
if the class element size or expr3 are non-null.
* trans-expr.c (gfc_conv_class_to_class): Give this function
global scope.
(get_class_array_ref): New function.
(gfc_copy_class_to_class): New function.
* trans-array.h : Update prototype for gfc_array_allocate.
* trans-stmt.c (gfc_trans_allocate): For non-variable class
STATUS expressions extract the class object and the dynamic
element size. Use the latter to call gfc_array_allocate and
the former for setting the vptr and, via
gfc_copy_class_to_clasfc_cs, to copy to the allocated data.
* trans.h : Prototypes for gfc_get_class_array_ref,
gfc_copy_class_to_class and gfc_conv_class_to_class.
2012-01-27 Paul Thomas <pault@gcc.gnu.org>
Tobias Burnus <burnus@gcc.gnu.org>
PR fortran/48705
* gfortran.dg/class_allocate_11.f03: New.
PR fortran/51870
PR fortran/51943
PR fortran/51946
* gfortran.dg/class_allocate_7.f03: New.
* gfortran.dg/class_allocate_8.f03: New.
* gfortran.dg/class_allocate_9.f03: New.
* gfortran.dg/class_allocate_10.f03: New.
Co-Authored-By: Tobias Burnus <burnus@gcc.gnu.org>
From-SVN: r183613
Diffstat (limited to 'gcc/fortran/trans-array.h')
-rw-r--r-- | gcc/fortran/trans-array.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/gcc/fortran/trans-array.h b/gcc/fortran/trans-array.h index ed922d0..6ca630e 100644 --- a/gcc/fortran/trans-array.h +++ b/gcc/fortran/trans-array.h @@ -25,7 +25,7 @@ tree gfc_array_deallocate (tree, tree, tree, tree, tree, gfc_expr*); /* Generate code to initialize and allocate an array. Statements are added to se, which should contain an expression for the array descriptor. */ bool gfc_array_allocate (gfc_se *, gfc_expr *, tree, tree, tree, tree, - gfc_expr *); + tree, tree *, gfc_expr *); /* Allow the bounds of a loop to be set from a callee's array spec. */ void gfc_set_loop_bounds_from_array_spec (gfc_interface_mapping *, |