2012-01-27 Paul Thomas <pault@gcc.gnu.org>
commit112437c16b4da6ee6f44a866874c43ce9fe879d8
authorpault <pault@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 27 Jan 2012 10:05:56 +0000 (27 10:05 +0000)
committerpault <pault@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 27 Jan 2012 10:05:56 +0000 (27 10:05 +0000)
tree2f2b76a32e0f1e1dd26a98bf3470caf96f4b01eb
parentbfa2a0bac16e46ccc52cc755c659416d026f89e6
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.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@183613 138bc75d-0d04-0410-961f-82ee72b054a4
12 files changed:
gcc/fortran/ChangeLog
gcc/fortran/trans-array.c
gcc/fortran/trans-array.h
gcc/fortran/trans-expr.c
gcc/fortran/trans-stmt.c
gcc/fortran/trans.h
gcc/testsuite/ChangeLog
gcc/testsuite/gfortran.dg/class_allocate_10.f03 [new file with mode: 0644]
gcc/testsuite/gfortran.dg/class_allocate_11.f03 [new file with mode: 0644]
gcc/testsuite/gfortran.dg/class_allocate_7.f03 [new file with mode: 0644]
gcc/testsuite/gfortran.dg/class_allocate_8.f03 [new file with mode: 0644]
gcc/testsuite/gfortran.dg/class_allocate_9.f03 [new file with mode: 0644]