https://gcc.gnu.org/bugzilla/show_bug.cgi?id=72832
--- Comment #13 from vehre at gcc dot gnu.org --- Author: vehre Date: Sun Oct 23 11:55:44 2016 New Revision: 241448 URL: https://gcc.gnu.org/viewcvs?rev=241448&root=gcc&view=rev Log: gcc/fortran/ChangeLog: 2016-10-23 Andre Vehreschild <ve...@gcc.gnu.org> Backport from trunk PR fortran/72832 * trans-expr.c (gfc_copy_class_to_class): Add generation of runtime array bounds check. * trans-intrinsic.c (gfc_conv_intrinsic_size): Add a crutch to get the descriptor of a function returning a class object. * trans-stmt.c (gfc_trans_allocate): Use the array spec on the array to allocate instead of the array spec from source=. gcc/testsuite/ChangeLog: 2016-10-23 Andre Vehreschild <ve...@gcc.gnu.org> Backport from trunk PR fortran/72832 * gfortran.dg/allocate_with_source_22.f03: New test. * gfortran.dg/allocate_with_source_23.f03: New test. Expected to fail. Added: branches/gcc-6-branch/gcc/testsuite/gfortran.dg/allocate_with_source_22.f03 branches/gcc-6-branch/gcc/testsuite/gfortran.dg/allocate_with_source_23.f03 Modified: branches/gcc-6-branch/gcc/fortran/ChangeLog branches/gcc-6-branch/gcc/fortran/trans-expr.c branches/gcc-6-branch/gcc/fortran/trans-intrinsic.c branches/gcc-6-branch/gcc/fortran/trans-stmt.c branches/gcc-6-branch/gcc/testsuite/ChangeLog