From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 30031 invoked by alias); 28 Jul 2015 08:38:31 -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 29978 invoked by uid 48); 28 Jul 2015 08:38:28 -0000 From: "t56xjcu6dh at snkmail dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug fortran/65766] gFortran Compiler SEGFAULTING on compiling simple program Date: Tue, 28 Jul 2015 08:38: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: 4.9.2 X-Bugzilla-Keywords: X-Bugzilla-Severity: major X-Bugzilla-Who: t56xjcu6dh at snkmail dot com X-Bugzilla-Status: NEW X-Bugzilla-Resolution: 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: attachments.created 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-07/txt/msg02428.txt.bz2 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65766 --- Comment #3 from Louis Krupp --- Created attachment 36080 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=36080&action=edit Proposed patch The problem is with substrings of allocatable string components of derived types. The code seems to be trying to get the string length from typespec of the derived type variable instead of from the component. The attached patch gets the component typespec from the reference chain. I don't understand the code well enough to have a lot of confidence in this patch, but it seems like a step in the right direction.