Go to file
Andre Vehreschild 34d9d74996 re PR fortran/64787 (Invalid code on sourced allocation of class(*) character string)
gcc/fortran/ChangeLog

2015-03-24  Andre Vehreschild  <vehre@gmx.de>

	PR fortran/64787
	PR fortran/57456
	PR fortran/63230
	* class.c (gfc_add_component_ref):  Free no longer needed
	ref-chains to prevent memory loss.
	(find_intrinsic_vtab): For deferred length char arrays or
	unlimited polymorphic objects, store the size in bytes of one
	character in the size component of the vtab.
	* gfortran.h: Added gfc_add_len_component () define.
	* trans-array.c (gfc_trans_create_temp_array): Switched to new
	function name for getting a class' vtab's field.
	(build_class_array_ref): Likewise.
	(gfc_array_init_size): Using the size information from allocate
	more consequently now, i.e., the typespec of the entity to
	allocate is no longer needed.  This is to address the last open
	comment in PR fortran/57456.
	(gfc_array_allocate): Likewise.
	(structure_alloc_comps): gfc_copy_class_to_class () needs to
	know whether the class is unlimited polymorphic.
	* trans-array.h: Changed interface of gfc_array_allocate () to
	reflect the no longer needed typespec.
	* trans-expr.c (gfc_find_and_cut_at_last_class_ref): New.
	(gfc_reset_len): New.
	(gfc_get_class_array_ref): Switch to new function name for
	getting a class' vtab's field.
	(gfc_copy_class_to_class):  Added flag to know whether the class
	to copy is unlimited polymorphic.  Adding _len dependent code
	then, which calls ->vptr->copy () with four arguments adding
	the length information ->vptr->copy(from, to, from_len, to_cap).
	(gfc_conv_procedure_call): Switch to new function name for
	getting a class' vtab's field.
	(alloc_scalar_allocatable_for_assignment): Use the string_length
	as computed by gfc_conv_expr and not the statically backend_decl
	which may be incorrect when ref-ing.
	(gfc_trans_assignment_1): Use the string_length variable and
	not the rse.string_length.  The former has been computed more
	generally.
	* trans-intrinsic.c (gfc_conv_intrinsic_sizeof): Switch to new
	function name for getting a class' vtab's field.
	(gfc_conv_intrinsic_storage_size): Likewise.
	(gfc_conv_intrinsic_transfer): Likewise.
	* trans-stmt.c (gfc_trans_allocate): Restructured to evaluate
	source=expr3 only once before the loop over the objects to
	allocate, when the objects are not arrays. Doing correct _len
	initialization and calling of vptr->copy () fixing PR 64787.
	(gfc_trans_deallocate): Reseting _len to 0, preventing future
	errors.
	* trans.c (gfc_build_array_ref): Switch to new function name
	for getting a class' vtab's field.
	(gfc_add_comp_finalizer_call): Likewise.
	* trans.h: Define the prototypes for the gfc_class_vtab_*_get ()
	and gfc_vptr_*_get () functions.
	Added gfc_find_and_cut_at_last_class_ref () and
	gfc_reset_len () routine prototype.  Added flag to
	gfc_copy_class_to_class () prototype to signal an unlimited
	polymorphic entity to copy.

gcc/testsuite/ChangeLog

2015-03-24  Andre Vehreschild  <vehre@gmx.de>

	* gfortran.dg/allocate_alloc_opt_13.f90: Added tests for
	source= and mold= expressions functionality.
	* gfortran.dg/allocate_class_4.f90: New test.
	* gfortran.dg/unlimited_polymorphic_20.f90: Added test whether
	copying an unlimited polymorhpic object containing a char array
	to another unlimited polymorphic object respects the _len
	component.
	* gfortran.dg/unlimited_polymorphic_22.f90: Extended to check
	whether deferred length char array allocate works, unlimited
	polymorphic object allocation from a string works and if
	allocating an array of deferred length strings works.
	* gfortran.dg/unlimited_polymorphic_24.f03: New test.

From-SVN: r221621
2015-03-24 11:28:48 +01:00
boehm-gc
config Move cloog.m4 ChangeLog entry to config/ChangeLog 2015-03-16 08:28:58 -07:00
contrib dg-extract-results.sh: Check that the necessary python modules exist. 2015-03-06 18:35:15 +00:00
fixincludes Change stdlib.h base, not inttypes.h 2015-02-17 09:45:48 -05:00
gcc re PR fortran/64787 (Invalid code on sourced allocation of class(*) character string) 2015-03-24 11:28:48 +01:00
gnattools
gotools Makefile.am (GOLINK): Add GOCFLAGS. 2015-03-12 16:44:36 +00:00
include partition.h (struct partition_elem): Re-order elements to avoid padding. 2015-03-19 11:44:08 +00:00
INSTALL
intl
libada
libatomic Avoid misaligned atomic operations 2015-01-21 09:17:03 -08:00
libbacktrace Move wrong ChangeLog entry from the toplevel ChangeLog to 2015-01-26 14:51:12 +00:00
libcc1 Always pass explicit location to fatal_error. 2015-01-30 16:15:00 +00:00
libcilkrts configure.ac: Move AM_ENABLE_MULTILIB before AC_PROG_CC. 2015-01-26 22:54:31 +00:00
libcpp * fr.po: Update. 2015-03-23 15:34:57 +00:00
libdecnumber
libffi ffitarget.h (ffi_arg): Use unsigned long long for ILP32. 2015-02-10 14:46:47 -08:00
libgcc Implement call0 ABI for xtensa 2015-03-03 17:44:01 +00:00
libgfortran re PR libfortran/59513 (Fortran runtime error: Sequential READ or WRITE not allowed after EOF marker, possibly use REWIND or BACKSPACE) 2015-03-22 18:42:52 +00:00
libgo libgo/README: Minor updates. 2015-03-13 18:53:13 +00:00
libgomp reduction-4.c: Don't run on hppa*-*-hpux*. 2015-03-21 16:19:43 +00:00
libiberty strerror.c: Do not declare sys_nerr or sys_errlist if already macros 2015-01-19 15:28:56 +00:00
libitm
libjava cygwin.h (LIBGCJ_SONAME): Set libgcj version to -16. 2015-01-29 00:34:03 +00:00
libmpx re PR other/65384 (Intel MPX does not support x32) 2015-03-12 08:58:08 +00:00
libobjc Fix failures on AIX (PR libobjc/63765) 2015-02-05 09:41:44 +00:00
liboffloadmic
libquadmath configure.ac: Move AM_ENABLE_MULTILIB before AC_PROG_CC. 2015-01-26 14:57:41 +00:00
libsanitizer re PR sanitizer/59009 (libsanitizer merge from upstream r191666 breaks bootstrap on powerpc64-linux and aarch64-linux) 2015-03-23 14:43:22 +01:00
libssp ssp.c (__guard_setup): For Windows... 2015-02-09 18:44:08 -07:00
libstdc++-v3 re PR libstdc++/64967 (Bootstrap fails due to errors in libstdc++ sources with `--enable-symvers=gnu-versioned-namespace') 2015-03-23 16:47:18 +00:00
libvtv libvtv: autoreconf. 2015-02-09 12:41:22 +01:00
lto-plugin Revert the PR lto/64837 fix 2015-02-06 05:55:42 -08:00
maintainer-scripts Complete previous change. 2015-02-25 16:47:05 +01:00
zlib
.dir-locals.el
.gitignore
ABOUT-NLS
ChangeLog Move cloog.m4 ChangeLog entry to config/ChangeLog 2015-03-16 08:28:58 -07:00
ChangeLog.jit
ChangeLog.tree-ssa
compile
config-ml.in
config.guess
config.rpath
config.sub
configure re PR bootstrap/25672 (cross build's libgcc picks up CFLAGS) 2015-03-10 16:37:53 +00:00
configure.ac re PR bootstrap/25672 (cross build's libgcc picks up CFLAGS) 2015-03-10 16:37:53 +00:00
COPYING
COPYING3
COPYING3.LIB
COPYING.LIB
COPYING.RUNTIME
depcomp
install-sh
libtool-ldflags
libtool.m4
lt~obsolete.m4
ltgcc.m4
ltmain.sh
ltoptions.m4
ltsugar.m4
ltversion.m4
MAINTAINERS MAINTAINERS (CPU Port Maintainers): Add myself i386 vector ISA extns mantainer. 2015-03-06 14:49:03 +00:00
Makefile.def Makefile.def: Add libmpx. 2015-03-10 09:37:41 +00:00
Makefile.in Makefile.def: Add libmpx. 2015-03-10 09:37:41 +00:00
Makefile.tpl
missing
mkdep
mkinstalldirs
move-if-change
README
symlink-tree
ylwrap

This directory contains the GNU Compiler Collection (GCC).

The GNU Compiler Collection is free software.  See the files whose
names start with COPYING for copying permission.  The manuals, and
some of the runtime libraries, are under different terms; see the
individual source files for details.

The directory INSTALL contains copies of the installation information
as HTML and plain text.  The source of this information is
gcc/doc/install.texi.  The installation information includes details
of what is included in the GCC sources and what files GCC installs.

See the file gcc/doc/gcc.texi (together with other files that it
includes) for usage and porting information.  An online readable
version of the manual is in the files gcc/doc/gcc.info*.

See http://gcc.gnu.org/bugs/ for how to report bugs usefully.

Copyright years on GCC source files may be listed using range
notation, e.g., 1987-2012, indicating that every year in the range,
inclusive, is a copyrightable year that could otherwise be listed
individually.