2015-10-18 Paul Thomas <pault@gcc.gnu.org>
commit6f29994cb8c6a797f241adac76663143309c03dd
authorpault <pault@138bc75d-0d04-0410-961f-82ee72b054a4>
Sun, 18 Oct 2015 09:31:21 +0000 (18 09:31 +0000)
committerpault <pault@138bc75d-0d04-0410-961f-82ee72b054a4>
Sun, 18 Oct 2015 09:31:21 +0000 (18 09:31 +0000)
treea0441a3335a1f9021773ff84b515947483dce8b6
parent35ece5a6f82ab846ceb930661f50e4ba192ba682
2015-10-18  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-18  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

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@228940 138bc75d-0d04-0410-961f-82ee72b054a4
gcc/fortran/ChangeLog
gcc/fortran/primary.c
gcc/fortran/trans-expr.c
gcc/fortran/trans-intrinsic.c
gcc/testsuite/ChangeLog
gcc/testsuite/gfortran.dg/deferred_character_assignment_1.f90 [new file with mode: 0644]
gcc/testsuite/gfortran.dg/move_alloc_15.f90 [new file with mode: 0644]
gcc/testsuite/gfortran.dg/move_alloc_16.f90 [new file with mode: 0644]