From patchwork Sun Jun 5 18:09:52 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andre Vehreschild X-Patchwork-Id: 630488 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3rN5Tt0fFcz9t4P for ; Mon, 6 Jun 2016 04:10:25 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b=WipsPeQm; dkim-atps=neutral DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:date :from:to:cc:subject:message-id:in-reply-to:references :mime-version:content-type; q=dns; s=default; b=NYP/GfXCIczqF22t iFqb/NzjyFPxZlVyBvjrJ+kh4Jns69QV5ghCk81VjsSIB20Wds5aVbQfZx0YFTL9 O3qtz8vdGc9bU5q0kbGOgIbnBezFERNWLRIfWheDqq5Lk3XUyiXMZxDKb0uwJ+dI 4TrPr4NUZ1Z5Zt+IGFlFAG5w2wY= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:date :from:to:cc:subject:message-id:in-reply-to:references :mime-version:content-type; s=default; bh=a5bLIBANR4PRj49mQrSeL5 6jQzA=; b=WipsPeQmZtuVO6lMVHmmqSALBTA/sYMq4FRADoBvUltNV8tcwOZDRK +5nye7uWK7lI5+GCE0Y++hfyEjxhG1OXUOpbCVnoRAvqYZ6de11mmsNkA5EGN6Ti PLgQM9NhFnblJYFL46NVyRX75WvePYWn58ryXxhOlg0mxRIS7TdfE= Received: (qmail 13241 invoked by alias); 5 Jun 2016 18:10:09 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Received: (qmail 13209 invoked by uid 89); 5 Jun 2016 18:10:09 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.0 required=5.0 tests=AWL, BAYES_00, FREEMAIL_FROM, KAM_ASCII_DIVIDERS, RCVD_IN_DNSWL_LOW, SPF_PASS autolearn=no version=3.3.2 spammy=nicht, harvey, paulrichardthomasgmailcom, paul.richard.thomas@gmail.com X-Spam-User: qpsmtpd, 2 recipients X-HELO: mout.gmx.net Received: from mout.gmx.net (HELO mout.gmx.net) (212.227.17.22) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Sun, 05 Jun 2016 18:09:58 +0000 Received: from vepi2 ([84.59.202.204]) by mail.gmx.com (mrgmx101) with ESMTPSA (Nemesis) id 0LpObx-1bdkiD3FMT-00f70f; Sun, 05 Jun 2016 20:09:52 +0200 Date: Sun, 5 Jun 2016 20:09:52 +0200 From: Andre Vehreschild To: Paul Richard Thomas Cc: "fortran@gcc.gnu.org" , gcc-patches Subject: Re: Ping! [fortran, patch, pr69659, v1] [6/7 Regression] ICE on using option -frepack-arrays, in gfc_conv_descriptor_data_get Message-ID: <20160605200952.6b391ef3@vepi2> In-Reply-To: References: <20160522185122.20972f20@vepi2> <20160605140459.4d0e5ed3@vepi2> <20160605161310.68954abc@vepi2> MIME-Version: 1.0 X-UI-Out-Filterresults: notjunk:1; V01:K0:0HYGkNRiot4=:MNTLIj65yYt/a1FciP4+cj hgQNP7WdeXWuIcDHwpYg7S2GvHg+G2Haj1IoIRzz3q239NHzAME8F7vQ4L8EeL1+IVNJ0yYh+ bWeRqyfATw5XT6Z/teToLFzWRoQmqgoyUFGdOd6gCxSz/thpTW4vPYqgFOgwCcp3U+AIkancm y58KmSopteNsuHu1KQxLmHlHB7rdKAcy0Kvh2g/FF8eXAZmhF+u/Qw+dso0lFJi+KaIVna5ca NrPF3TVp2iK6wS7/rRljJLMm1uDNN5WwMr/uOGZ+RG1/to0IlfmqFJHC8WFJX542f8gzYj6jB W/Lmvw25VXr5qJ0I4d4Pd45QJ955jakx4nY7+NVzOK/efiOcnAj/T0Qsnz5D6whwRj3aqApaM L+LcGLO3w/PinPAc/Xwpodkdnom7JZ/qklTfqVsczK6b4UZmzXdv6yqhvIBq0qvhbk6iOQ6c9 bUGDJ4g01J3aTBc03RoyZ3/5ZQUg367Gy24Z+h69G4da7VH3PH+/3AkVxab+L1ZMmyP9lWaE2 w30zYIgyEwvqWSWB9or5Ekc+MBczBGaHWsaw9qQf8W4OsYz7nmzvlsiIdt1sKV5Zf2JoUrKg+ WIJKpaaaQXJl+mcFJ6vklhVCcpv3rPlTKwS1CsZ7Wp6WTLlIoVoS8igkYOWUbTFFDcg0uHVq5 bLM8NTcgSt/kIl5J7ARj5+TeCJMcHgUTNdaKFVWCmra+P40qQDA3McfOsJI35dWVLA/SRnAa0 PEPk8mmiTjechV66xKilvR40Uc8T/WthOR9JNR7ANA8uI1AqWd3i+3J1W/0= Hi Paul, thanks for quick review. Comitted as r237105 for trunk. And r237107 for branch-6. Thanks again and regards, Andre On Sun, 5 Jun 2016 17:44:19 +0200 Paul Richard Thomas wrote: > Hi Andre, > > That's verging on 'obvious' and even does the job :-) > > OK for trunk and 6-branch. > > Thanks for the patch > > Paul > > On 5 June 2016 at 16:13, Andre Vehreschild wrote: > > Hi Paul, > > > > now with attachment. > > > > - Andre > > > > On Sun, 5 Jun 2016 16:06:09 +0200 > > Paul Richard Thomas wrote: > > > >> Hi Andre, > >> > >> There's no attachment. Get it posted tonight and I will take a look at it. > >> > >> Cheers > >> > >> Paul > >> > >> On 5 June 2016 at 14:04, Andre Vehreschild wrote: > >> > Ping! > >> > > >> > On Sun, 22 May 2016 18:51:22 +0200 > >> > Andre Vehreschild wrote: > >> > > >> >> Hi all, > >> >> > >> >> attached patch fixes a regression that occurred on some testcases when > >> >> doing a validation run with -frepack-arrays. The issue here was that > >> >> for class arrays the array descriptor is in the _data component and not > >> >> directly at the address of the class_array. The patch fixes this issue > >> >> for pr69659 on trunk 7 and gcc-6-branch. > >> >> > >> >> Ok for trunk and gcc-6? > >> >> > >> >> Bootstrapped and regtested on x86_64-linux-gnu. > >> >> > >> >> Regards, > >> >> Andre > >> > > >> > > >> > -- > >> > Andre Vehreschild * Email: vehre ad gmx dot de > >> > >> > >> > > > > > > -- > > Andre Vehreschild * Email: vehre ad gmx dot de > > > Index: gcc/fortran/ChangeLog =================================================================== --- gcc/fortran/ChangeLog (Revision 237101) +++ gcc/fortran/ChangeLog (Arbeitskopie) @@ -1,3 +1,10 @@ +2016-06-05 Andre Vehreschild + + PR fortran/69659 + * trans-array.c (gfc_trans_dummy_array_bias): For class arrays use + the address of the _data component to reference the arrays data + component. + 2016-06-01 Paul Thomas PR fortran/71156 Index: gcc/fortran/trans-array.c =================================================================== --- gcc/fortran/trans-array.c (Revision 237101) +++ gcc/fortran/trans-array.c (Arbeitskopie) @@ -6376,7 +6376,12 @@ stmtCleanup = gfc_finish_block (&cleanup); /* Only do the cleanup if the array was repacked. */ - tmp = build_fold_indirect_ref_loc (input_location, dumdesc); + if (is_classarray) + /* For a class array the dummy array descriptor is in the _class + component. */ + tmp = gfc_class_data_get (dumdesc); + else + tmp = build_fold_indirect_ref_loc (input_location, dumdesc); tmp = gfc_conv_descriptor_data_get (tmp); tmp = fold_build2_loc (input_location, NE_EXPR, boolean_type_node, tmp, tmpdesc); Index: gcc/testsuite/ChangeLog =================================================================== --- gcc/testsuite/ChangeLog (Revision 237101) +++ gcc/testsuite/ChangeLog (Arbeitskopie) @@ -1,3 +1,8 @@ +2016-06-05 Andre Vehreschild + + PR fortran/69659 + * gfortran.dg/class_array_22.f03: New test. + 2016-06-03 Bill Schmidt PR target/70957 Index: gcc/testsuite/gfortran.dg/class_array_22.f03 =================================================================== --- gcc/testsuite/gfortran.dg/class_array_22.f03 (nicht existent) +++ gcc/testsuite/gfortran.dg/class_array_22.f03 (Arbeitskopie) @@ -0,0 +1,25 @@ +! { dg-do compile } +! { dg-options "-frepack-arrays " } +! +! Original class_array_11.f03 but with -frepack-arrays a new +! ICE was produced reported in +! PR fortran/69659 +! +! Original testcase by Ian Harvey +! Reduced by Janus Weil + + IMPLICIT NONE + + TYPE :: ParentVector + INTEGER :: a + END TYPE ParentVector + +CONTAINS + + SUBROUTINE vector_operation(pvec) + CLASS(ParentVector), INTENT(INOUT) :: pvec(:) + print *,pvec(1)%a + END SUBROUTINE + +END +