From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 28619 invoked by alias); 30 Nov 2014 17:50:51 -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 28593 invoked by uid 48); 30 Nov 2014 17:50:46 -0000 From: "fmartinez at gmv dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug fortran/64125] New: Allocation of character strings Date: Sun, 30 Nov 2014 17:50:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: fortran X-Bugzilla-Version: 5.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: fmartinez at gmv dot com X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter Message-ID: 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: 2014-11/txt/msg03445.txt.bz2 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64125 Bug ID: 64125 Summary: Allocation of character strings Product: gcc Version: 5.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: fortran Assignee: unassigned at gcc dot gnu.org Reporter: fmartinez at gmv dot com Hi. The following code inside a module causes the compiler to crash (also in the latest version of 4.9) allocate( character(len=size(right))::left%chars ) ^ internal compiler error: in gimplify_expr, at gimplify.c:8646 0x572c28 ??? ../sysdeps/x86_64/elf/start.S:113 Cheers, Fran type t_string private character(len=:), allocatable :: chars end type t_string pure subroutine string_assign_from_array( left, right ) ! The target string type(t_string), intent(out) :: left ! The source string character, dimension(:), intent(in) :: right ! Copy memory allocate( character(len=size(right)) :: left%chars ) left%chars = transfer( right, left%chars ) end subroutine string_assign_from_array