From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 103222 invoked by alias); 22 May 2016 16:51:55 -0000 Mailing-List: contact fortran-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Post: List-Help: , Sender: fortran-owner@gcc.gnu.org Received: (qmail 103204 invoked by uid 89); 22 May 2016 16:51:54 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.6 required=5.0 tests=BAYES_00,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=ham version=3.3.2 spammy=harvey, Harvey, Ian, janus X-Spam-User: qpsmtpd, 2 recipients X-HELO: mout.gmx.net Received: from mout.gmx.net (HELO mout.gmx.net) (212.227.15.19) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Sun, 22 May 2016 16:51:44 +0000 Received: from vepi2 ([84.59.202.204]) by mail.gmx.com (mrgmx003) with ESMTPSA (Nemesis) id 0M5tof-1bSGZv1Iu9-00xsxN; Sun, 22 May 2016 18:51:38 +0200 Date: Sun, 22 May 2016 16:51:00 -0000 From: Andre Vehreschild To: GCC-Patches-ML , GCC-Fortran-ML Subject: [fortran, patch, pr69659, v1] [6/7 Regression] ICE on using option -frepack-arrays, in gfc_conv_descriptor_data_get Message-ID: <20160522185122.20972f20@vepi2> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="MP_/myRQQM+S_FL0co6UjNbyd_+" X-UI-Out-Filterresults: notjunk:1;V01:K0:ZUSyMuv5gV8=:F5c0seclNfUNULV9oCDCGb bm2fWgo8qiMk9d1NGh2Fu/TaxZQNTuaCZX84Vt+4ZHCKWDB+go8mUy4ZeV4FI4tVo2GyxUSgy +83tMs38L/Dtk1ldiI5mTSOd9Z4kkpI6ZBl0D4GvmZ/aePDrbpFFHOhmhiT4Iol9aENfmbX3C rsOA3jxSAm2rnSJcVhvv1QTgaj8PRuQuuEU60ChNyCWgUokVABWslj/rieFw81cqxhYkNcK5L 9vEotrRcwvvGFkWvqveoX4qKHr5KTGk2pBar+bnk38j+wa0p6/Z7FVoxWpzurUHom3H6l5AtL o2ll1kN9BLPOHJYO6I51wa7X0E2VFHB2TSkIYJlELRx5ylC96k73rvI9WhF5MKroGeqaeLwJb aAg4326B7iprNhX6VbsT4sM0+M45ZMdFZ5Irn+mjtjffZdqRjxAupABF7ClBwdldIu40pEmMY MwPhXbfL/6ihPAh2Z40L3YCh+YvzRq32YJMYUFZw5KGlPHXroXGW9SgZ3eJeOI7PHPONmvT5u PAGmrIgsqtqeBtZKRaZYUy1nRx7tgbZYQM2MYLGHI+70NEL3FN0GfkwfznHvIhSaE5OoHE3/c Mc3n3Kei6TrnQz/ndc1QhQTplDqrevKGbEHBVY2sChCdWwq6V6HmltNVz580AZ871Cmm9j/r+ 2COFa2+KblzI2l+5RgMrWzMtKf7PDU0Fk3X4+Dr8MZWi+3NU5PPtoJyrxlPCOBFDtOdYuk/ma N+lg/d7YLx2aTQ0FgROzqTGSaZdUnC5/cbZW3Bd0keXE5GMZAjKEHMWnm1CMlaa43Uy5OoIHw AUIrUI6kzmvCzQrSc9ZyMQiRKos3A== X-IsSubscribed: yes X-SW-Source: 2016-05/txt/msg00063.txt.bz2 --MP_/myRQQM+S_FL0co6UjNbyd_+ Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Content-Disposition: inline Content-length: 476 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 --MP_/myRQQM+S_FL0co6UjNbyd_+ Content-Type: text/x-patch Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=pr69659_1.patch Content-length: 1552 diff --git a/gcc/fortran/trans-array.c b/gcc/fortran/trans-array.c index 7be301d..403ce3a 100644 --- a/gcc/fortran/trans-array.c +++ b/gcc/fortran/trans-array.c @@ -6386,7 +6386,12 @@ gfc_trans_dummy_array_bias (gfc_symbol * sym, tree tmpdesc, 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); diff --git a/gcc/testsuite/gfortran.dg/class_array_22.f03 b/gcc/testsuite/gfortran.dg/class_array_22.f03 new file mode 100644 index 0000000..9410741 --- /dev/null +++ b/gcc/testsuite/gfortran.dg/class_array_22.f03 @@ -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 + --MP_/myRQQM+S_FL0co6UjNbyd_+ Content-Type: text/plain Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=pr69659_1.clog Content-length: 383 gcc/testsuite/ChangeLog: 2016-05-22 Andre Vehreschild PR fortran/69659 * gfortran.dg/class_array_22.f03: New test. gcc/fortran/ChangeLog: 2016-05-22 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. --MP_/myRQQM+S_FL0co6UjNbyd_+--