From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 109283 invoked by alias); 21 Jul 2015 10:36:43 -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 109240 invoked by uid 55); 21 Jul 2015 10:36:39 -0000 From: "vehre at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug fortran/66035] [5/6 Regression] gfortran ICE segfault Date: Tue, 21 Jul 2015 10:36: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.1.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: vehre at gcc dot gnu.org X-Bugzilla-Status: RESOLVED X-Bugzilla-Resolution: FIXED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: vehre 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-07/txt/msg01795.txt.bz2 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66035 --- Comment #8 from vehre at gcc dot gnu.org --- Author: vehre Date: Tue Jul 21 10:36:06 2015 New Revision: 226037 URL: https://gcc.gnu.org/viewcvs?rev=226037&root=gcc&view=rev Log: gcc/fortran/ChangeLog: 2015-07-21 Andre Vehreschild PR fortran/66035 * trans-expr.c (alloc_scalar_allocatable_for_subcomponent_assignment): Compute the size to allocate for class and derived type objects correclty. (gfc_trans_subcomponent_assign): Only allocate memory for a component when the object to assign is not an allocatable class object (the memory is already present for allocatable class objects). Furthermore use copy_class_to_class for assigning the rhs to the component (may happen for dummy class objects on the rhs). gcc/testsuite/ChangeLog: 2015-07-21 Andre Vehreschild PR fortran/66035 * gfortran.dg/structure_constructor_13.f03: New test. Added: branches/gcc-5-branch/gcc/testsuite/gfortran.dg/structure_constructor_13.f03 Modified: branches/gcc-5-branch/gcc/fortran/ChangeLog branches/gcc-5-branch/gcc/fortran/trans-expr.c branches/gcc-5-branch/gcc/testsuite/ChangeLog