This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/67177] MOVE_ALLOC not automatically allocating deferred character arrays in derived types
- From: "pault at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Mon, 26 Oct 2015 17:25:35 +0000
- Subject: [Bug fortran/67177] MOVE_ALLOC not automatically allocating deferred character arrays in derived types
- Auto-submitted: auto-generated
- References: <bug-67177-4 at http dot gcc dot gnu dot org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67177
--- Comment #5 from Paul Thomas <pault at gcc dot gnu.org> ---
Author: pault
Date: Mon Oct 26 17:25:03 2015
New Revision: 229386
URL: https://gcc.gnu.org/viewcvs?rev=229386&root=gcc&view=rev
Log:
2015-10-26 Paul Thomas <pault@gcc.gnu.org>
PR fortran/67177
PR fortran/67977
* primary.c (match_substring): Add an argument 'deferred' to
flag that a substring reference with null start and end should
not be optimized away for deferred length strings.
(match_string_constant, gfc_match_rvalue): Set the argument.
* trans-expr.c (alloc_scalar_allocatable_for_assignment): If
there is a substring reference return.
* trans-intrinsic.c (conv_intrinsic_move_alloc): For deferred
characters, assign the 'from' string length to the 'to' string
length. If the 'from' expression is deferred, set its string
length to zero. If the 'to' expression has allocatable
components, deallocate them.
2015-10-26 Paul Thomas <pault@gcc.gnu.org>
PR fortran/67177
* gfortran.dg/move_alloc_15.f90: New test
* gfortran.dg/move_alloc_16.f90: New test
PR fortran/67977
* gfortran.dg/deferred_character_assignment_1.f90: New test
Added:
branches/gcc-5-branch/gcc/testsuite/gfortran.dg/deferred_character_assignment_1.f90
branches/gcc-5-branch/gcc/testsuite/gfortran.dg/move_alloc_15.f90
branches/gcc-5-branch/gcc/testsuite/gfortran.dg/move_alloc_16.f90
Modified:
branches/gcc-5-branch/gcc/fortran/ChangeLog
branches/gcc-5-branch/gcc/fortran/primary.c
branches/gcc-5-branch/gcc/fortran/trans-expr.c
branches/gcc-5-branch/gcc/fortran/trans-intrinsic.c
branches/gcc-5-branch/gcc/testsuite/ChangeLog