From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 60173 invoked by alias); 25 Oct 2015 15:47:27 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 60152 invoked by uid 89); 25 Oct 2015 15:47:26 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.5 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=ham version=3.3.2 X-Spam-User: qpsmtpd, 2 recipients X-HELO: mout.gmx.net Received: from mout.gmx.net (HELO mout.gmx.net) (212.227.17.20) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-GCM-SHA384 encrypted) ESMTPS; Sun, 25 Oct 2015 15:47:24 +0000 Received: from vepi2 ([92.213.0.123]) by mail.gmx.com (mrgmx103) with ESMTPSA (Nemesis) id 0M85r3-1alcnx2PUv-00viug; Sun, 25 Oct 2015 16:47:20 +0100 Date: Sun, 25 Oct 2015 17:17:00 -0000 From: Andre Vehreschild To: Paul Richard Thomas Cc: "fortran@gcc.gnu.org" , gcc-patches Subject: Re: [Patch, fortran] PR67171 - [6 regression] sourced allocation Message-ID: <20151025164719.077974ce@vepi2> In-Reply-To: References: MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-UI-Out-Filterresults: notjunk:1;V01:K0:448HodfZXKM=:hOFSCEww/Mtiej5/DROzXy ekXFsSte7w+2x/i8YE2RsjAkbQQeQeYEJ7yji6fwlZ4J3YdCH3WLk78EHI8kBcUtpMui0Xav1 sIKxri3r2JvgyPuD2NVJnVAxyhQ722zuVYAp32PRjzjiKc/37Jmu/UtOcjidexob95yr6j72i fXhXFEQGElByO0LMDJpulWoNukSx7f2BWEn8fSivPB0mtQRqFRpVsfVkYvNa8SETZqIjiVRE+ 0bllJcQIlLOZ7CiEuK3h6j40d36nZqwyx+v2qJgoQ4jPpndoIIsCFeFz1kY1d0mGeTh/NT/9o lUI6xfAbzbK/QKgOwVNXi1GQaMHxv9K0DGVpmtoS+hit8Xp9o7ytCfqdZLr1A2+SW+NVcXs5W CvSF2LACzmmNbVrYefO/SzVTDv/CTAbEGKTRZlve4dBF/XJt2YUAhK8qcWjL9SVK3K+Dvnc3N PhY8IkrQ76Iy4JRBpYadcQf/nNuTLhlkJSnZCpsIYOAKAgPA5XR+aKzY15PLJvvp2gSPYU3jX 4tE2/8BPYIzZW0df02JIXcxGIF1GujQzimanvaVKWktBjjA5EqX4MhdkAEKNjzgBwtfp8ip2p JaZTvgOL+rUebebmn8a6Dk6lbGAmKP8giDfJyQfZfs2b3Cqcrm1+F0aKrMUNmjICJahjxs8Zw oiYck0QJ4mXzGoS0rQ+vhqeNZgcfarci8c5WnJ3pyLrYXnD25vCpYyeBH0ezyt5gOxDvj7eE0 M2MAQqFWjZHZNKuCvWp8VXNWgzMZTI2SjKLbffzXLXZW1P2BQ+POo+NaACDxCwAfRxCXcdI8r CUBQvwO X-SW-Source: 2015-10/txt/msg02616.txt.bz2 Hi Paul, I had a look at your patch, especially at the allocate() specific part and have nothing serious to complain about. I would love to see more comments to help beginners find there way in the code, but that's a thing I will never get. :-) Therefore, from my perspective ok for trunk and thanks for the patch. Regards, Andre On Sat, 24 Oct 2015 15:08:30 +0200 Paul Richard Thomas wrote: > Dear All, > > This patch does four things: > (i) On deallocating class components, the vptr is set to point to the > vtable of the declared type; > (ii) When digging out the last class reference, a NULL is returned if > the allocatable component is to the right of a part reference with > non-zero rank, so that the resulting ICE is removed. The previous > modification takes care of these cases for gfc_reset_vptr and > gfc_reset_len; > (iii) gfc_reset_vptr has been simplified by the use of > gfc_get_vptr_from_expr; and > (iv) All variable expressions for the source are passed to > gfc_trans-assignment, so that array sections work correctly. > > I see that Andre has already reserved the testcase > allocate_with_source_10, for the pending patch that I undertook to > review, so I will change this to #12 on submission > > OK for trunk? > > Cheers > > Paul > > 2015-01-24 Paul Thomas > > PR fortran/67171 > * trans-array.c (structure_alloc_comps): On deallocation of > class components, reset the vptr to the declared type vtable > and reset the _len field of unlimited polymorphic components. > *trans-expr.c (gfc_find_and_cut_at_last_class_ref): Bail out on > allocatable component references to the right of part reference > with non-zero rank and return NULL. > (gfc_reset_vptr): Simplify this function by using the function > gfc_get_vptr_from_expr. Return if the vptr is NULL_TREE. > (gfc_reset_len): If gfc_find_and_cut_at_last_class_ref returns > NULL return. > * trans-stmt.c (gfc_trans_allocate): Rely on the use of > gfc_trans_assignment if expr3 is a variable expression since > this deals correctly with array sections. > > 2015-01-24 Paul Thomas > > PR fortran/67171 > * gfortran.dg/allocate_with_source_10.f03: New test -- Andre Vehreschild * Email: vehre ad gmx dot de