From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 31770 invoked by alias); 18 Oct 2015 15:01:48 -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 30897 invoked by uid 55); 18 Oct 2015 15:01:41 -0000 From: "mikael at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug fortran/65841] Seg fault on intrinsic assignment to allocatable derived type with allocatable component Date: Sun, 18 Oct 2015 15:01: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.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: mikael 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-10/txt/msg01421.txt.bz2 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65841 --- Comment #7 from Mikael Morin --- Author: mikael Date: Sun Oct 18 15:01:03 2015 New Revision: 228945 URL: https://gcc.gnu.org/viewcvs?rev=228945&root=gcc&view=rev Log: PR fortran/67721 PR fortran/67818 Backport from mainline r222477: 2015-04-27 Andre Vehreschild PR fortran/59678 PR fortran/65841 gcc/fortran/ * trans-array.c (duplicate_allocatable): Fixed deep copy of allocatable components, which are liable for copy only, when they are allocated. (gfc_duplicate_allocatable): Add deep-copy code into if component allocated block. Needed interface change for that. (gfc_copy_allocatable_data): Supplying NULL_TREE for code to add into if-block for checking whether a component was allocated. (gfc_duplicate_allocatable_nocopy): Likewise. (structure_alloc_comps): Likewise. * trans-array.h: Likewise. * trans-expr.c (gfc_trans_alloc_subarray_assign): Likewise. * trans-openmp.c (gfc_walk_alloc_comps): Likewise. gcc/testsuite/ * gfortran.dg/alloc_comp_deep_copy_1.f03: New test. * gfortran.dg/alloc_comp_deep_copy_2.f03: New test. Added: branches/gcc-5-branch/gcc/testsuite/gfortran.dg/alloc_comp_deep_copy_1.f03 branches/gcc-5-branch/gcc/testsuite/gfortran.dg/alloc_comp_deep_copy_2.f03 Modified: branches/gcc-5-branch/gcc/fortran/ChangeLog branches/gcc-5-branch/gcc/fortran/trans-array.c branches/gcc-5-branch/gcc/fortran/trans-array.h branches/gcc-5-branch/gcc/fortran/trans-expr.c branches/gcc-5-branch/gcc/fortran/trans-openmp.c branches/gcc-5-branch/gcc/testsuite/ChangeLog