From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 70906 invoked by alias); 18 Oct 2015 09:32:06 -0000 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org Received: (qmail 70523 invoked by uid 55); 18 Oct 2015 09:31:59 -0000 From: "pault at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug fortran/67177] MOVE_ALLOC not automatically allocating deferred character arrays in derived types Date: Sun, 18 Oct 2015 09:32:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: fortran X-Bugzilla-Version: 5.2.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: pault at gcc dot gnu.org X-Bugzilla-Status: NEW X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: pault at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-SW-Source: 2015-10/txt/msg01401.txt.bz2 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67177 --- Comment #4 from Paul Thomas --- Author: pault Date: Sun Oct 18 09:31:21 2015 New Revision: 228940 URL: https://gcc.gnu.org/viewcvs?rev=228940&root=gcc&view=rev Log: 2015-10-18 Paul Thomas 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 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: trunk/gcc/testsuite/gfortran.dg/deferred_character_assignment_1.f90 trunk/gcc/testsuite/gfortran.dg/move_alloc_15.f90 trunk/gcc/testsuite/gfortran.dg/move_alloc_16.f90 Modified: trunk/gcc/fortran/ChangeLog trunk/gcc/fortran/primary.c trunk/gcc/fortran/trans-expr.c trunk/gcc/fortran/trans-intrinsic.c trunk/gcc/testsuite/ChangeLog