This is the mail archive of the
gcc-cvs@gcc.gnu.org
mailing list for the GCC project.
r241885 - in /trunk/gcc: fortran/ChangeLog fort...
- From: vehre at gcc dot gnu dot org
- To: gcc-cvs at gcc dot gnu dot org
- Date: Sun, 06 Nov 2016 16:10:22 -0000
- Subject: r241885 - in /trunk/gcc: fortran/ChangeLog fort...
Author: vehre
Date: Sun Nov 6 16:10:22 2016
New Revision: 241885
URL: https://gcc.gnu.org/viewcvs?rev=241885&root=gcc&view=rev
Log:
gcc/testsuite/ChangeLog:
2016-11-06 Andre Vehreschild <vehre@gcc.gnu.org>
* gfortran.dg/allocate_with_source_14.f03: Fixed number mallocs
occuring.
gcc/fortran/ChangeLog:
2016-11-06 Andre Vehreschild <vehre@gcc.gnu.org>
* expr.c (is_non_empty_structure_constructor): New function to detect
non-empty structure constructor.
(gfc_has_default_initializer): Analyse initializers.
* resolve.c (cond_init): Removed.
(resolve_allocate_expr): Removed dead code. Moved invariant code out
of the loop over all objects to allocate.
(resolve_allocate_deallocate): Added the invariant code remove from
resolve_allocate_expr.
* trans-array.c (gfc_array_allocate): Removed nullify of structure
components in favour of doing this in gfc_trans_allocate for both
scalars and arrays in the same place.
* trans-expr.c (gfc_trans_init_assign): Always using _vptr->copy for
class objects.
* trans-stmt.c (allocate_get_initializer): Get the initializer
expression for object allocated.
(gfc_trans_allocate): Nullify a derived type only, when no SOURCE=
or MOLD= is present preventing duplicate work. Moved the creation
of the init-expression here to prevent code for conditions that
can not occur on freshly allocated object, like checking for the need
to free allocatable components.
Modified:
trunk/gcc/fortran/ChangeLog
trunk/gcc/fortran/expr.c
trunk/gcc/fortran/resolve.c
trunk/gcc/fortran/trans-array.c
trunk/gcc/fortran/trans-expr.c
trunk/gcc/fortran/trans-stmt.c
trunk/gcc/testsuite/ChangeLog
trunk/gcc/testsuite/gfortran.dg/allocate_with_source_14.f03