From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 17022 invoked by alias); 8 Aug 2016 08:25:05 -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 14464 invoked by uid 89); 8 Aug 2016 08:25:03 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.7 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, U*kargl, sk:karglg, karglgccgnuorg 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 ESMTP; Mon, 08 Aug 2016 08:24:52 +0000 Received: from vepi2 ([92.209.45.60]) by mail.gmx.com (mrgmx101) with ESMTPSA (Nemesis) id 0Lpfas-1b3gdf2OHe-00fVwG; Mon, 08 Aug 2016 10:24:45 +0200 Date: Mon, 08 Aug 2016 08:25:00 -0000 From: Andre Vehreschild To: Thomas Koenig Cc: GCC-Patches-ML , GCC-Fortran-ML Subject: Re: Ping [Fortran, Patch, pr70524, v1] [5/6/7 Regression] ICE when using -frepack-arrays -Warray-temporaries Message-ID: <20160808102444.59cd2018@vepi2> In-Reply-To: References: <20160725125514.25312866@vepi2> <20160806110704.1e9de270@vepi2> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="MP_/TpIHDznz9.3XSVYY1v9CrJc" X-UI-Out-Filterresults: notjunk:1;V01:K0:p3bsu2sszyI=:lyoe/UwCFzAxicOS2dgJbm XZt5SQ+F3PFh/LU1M5gp8xgmhI0B82h5k5jdU7Mshe0IXGzlR9Tb7WBYbw11BE2hoocLzgcGM mjqL3r9Eleq1YwpjEF4ha5uCd7C4T8NAfowSjeHn5pqB/Qzf7CS1VGweZ6Bqb1NUApscr4xzD QB3p1V44YpbGpAJEqXjXDjPAxXlPKPlPm0VM0RHV8ZsOVvnh0vA0Cza5N2uIfjZL0sbhriyDr 6eG/UBrAjFi7ZKRzYcgqwEgB+QLRMQvW71grwPII+Qxps0+tIG4bH/FxOm6z2Z2+tXfFuK7xe XxJVeJskbB4wKHKcK5LBxSVZ8cjgeTDVWhxcQMj6iTDTCSN8FvxS3/Sugqe4DytqeuxA1yuGR zA6ZkyXO06wJ9l9Ej7x/podgKZpOo53PCZ/S+MinZ+Fa8QD75x6hsSrsZx+ec4LNhK8vbDadP /NMrnso9k6dBeerSoSFm9nOy/7mz7HvpAHHtTLhfCL0sTOpJyUkvOB++lLICoDQxmKGafKVg8 xfMCbjxXWaFEQuTgGyVjElle2p6g/XqWGken/CXqG+PU8DE7n78vSx5+T2d8qPB5kIuPu+F+0 wH5QMppGG0YNOqmFqnRHOVs62IjmNIrMSRnyrcfCEGHalZckFHeQ70qkpC+0+FN+DhDJ23S7p rknQ47/bXxJ/khTY0UDscWiiIkuJTp8x6UG0EpO4Z67KoBOeOJBVhGkuI0X5+aNxOuPCaNKpD Og2Yl/kUViugBwdPBHMzOPJHS6hXMf+qJ3iQDvHPjeOChR7Tm+4zBYt8q/Q= X-SW-Source: 2016-08/txt/msg00571.txt.bz2 --MP_/TpIHDznz9.3XSVYY1v9CrJc Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Content-Disposition: inline Content-length: 366 Hi Thomas, thanks for the review. Committed as r239230 in trunk, r239231 in gcc-6-branch, r239232 in gcc-5-branch. Thanks again, Andre On Mon, 8 Aug 2016 08:37:16 +0200 Thomas Koenig wrote: > Hi Andre, > > the patch is OK. > > > > Ping. > > Regards > > Thomas > -- Andre Vehreschild * Email: vehre ad gmx dot de --MP_/TpIHDznz9.3XSVYY1v9CrJc Content-Type: text/x-patch Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=submit.diff Content-length: 3193 Index: gcc/fortran/ChangeLog =================================================================== --- gcc/fortran/ChangeLog (Revision 239229) +++ gcc/fortran/ChangeLog (Arbeitskopie) @@ -1,3 +1,11 @@ +2016-08-08 Andre Vehreschild + + PR fortran/70524 + * trans-array.c (gfc_trans_dummy_array_bias): Ensure that the + location information is correctly set. + * trans-decl.c (gfc_trans_deferred_vars): Set the locus of the + current construct early. + 2016-08-03 Fritz Reese * lang.opt: New option -fdec-intrinsic-ints. Index: gcc/fortran/trans-array.c =================================================================== --- gcc/fortran/trans-array.c (Revision 239229) +++ gcc/fortran/trans-array.c (Arbeitskopie) @@ -6103,7 +6103,12 @@ return; } + loc.nextc = NULL; gfc_save_backend_locus (&loc); + /* loc.nextc is not set by save_backend_locus but the location routines + depend on it. */ + if (loc.nextc == NULL) + loc.nextc = loc.lb->line; gfc_set_backend_locus (&sym->declared_at); /* Descriptor type. */ Index: gcc/fortran/trans-decl.c =================================================================== --- gcc/fortran/trans-decl.c (Revision 239229) +++ gcc/fortran/trans-decl.c (Arbeitskopie) @@ -4087,6 +4087,8 @@ else if (proc_sym->as) { tree result = TREE_VALUE (current_fake_result_decl); + gfc_save_backend_locus (&loc); + gfc_set_backend_locus (&proc_sym->declared_at); gfc_trans_dummy_array_bias (proc_sym, result, block); /* An automatic character length, pointer array result. */ @@ -4096,8 +4098,6 @@ tmp = NULL; if (proc_sym->ts.deferred) { - gfc_save_backend_locus (&loc); - gfc_set_backend_locus (&proc_sym->declared_at); gfc_start_block (&init); tmp = gfc_null_and_pass_deferred_len (proc_sym, &init, &loc); gfc_add_init_cleanup (block, gfc_finish_block (&init), tmp); Index: gcc/testsuite/ChangeLog =================================================================== --- gcc/testsuite/ChangeLog (Revision 239229) +++ gcc/testsuite/ChangeLog (Arbeitskopie) @@ -1,3 +1,8 @@ +2016-08-08 Andre Vehreschild + + PR fortran/70524 + * gfortran.dg/dependency_48.f90: New test. + 2016-08-07 Thomas Koenig PR fortran/70040 Index: gcc/testsuite/gfortran.dg/dependency_48.f90 =================================================================== --- gcc/testsuite/gfortran.dg/dependency_48.f90 (nicht existent) +++ gcc/testsuite/gfortran.dg/dependency_48.f90 (Arbeitskopie) @@ -0,0 +1,26 @@ +! { dg-do compile } +! { dg-options "-frepack-arrays -Warray-temporaries -O" } + +! Same as dependency_35 but with repack-arrays + +module foo + implicit none +contains + pure function bar(i,j) ! { dg-warning "Creating array temporary at \\(1\\)" } + integer, intent(in) :: i,j + integer, dimension(2,2) :: bar + bar = 33 + end function bar +end module foo + +program main + use foo + implicit none + integer a(2,2), b(2,2),c(2,2), d(2,2), e(2) + + read (*,*) b, c, d + a = matmul(b,c) + d + a = b + bar(3,4) + a = bar(3,4)*5 + b + e = sum(b,1) + 3 +end program main --MP_/TpIHDznz9.3XSVYY1v9CrJc Content-Type: text/x-patch Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=submit_gcc6.diff Content-length: 3211 Index: gcc/fortran/ChangeLog =================================================================== --- gcc/fortran/ChangeLog (Revision 239229) +++ gcc/fortran/ChangeLog (Arbeitskopie) @@ -1,3 +1,12 @@ +2016-08-08 Andre Vehreschild + + Backport from trunk: + PR fortran/70524 + * trans-array.c (gfc_trans_dummy_array_bias): Ensure that the + location information is correctly set. + * trans-decl.c (gfc_trans_deferred_vars): Set the locus of the + current construct early. + 2016-08-07 Thomas Koenig PR fortran/71795 Index: gcc/fortran/trans-array.c =================================================================== --- gcc/fortran/trans-array.c (Revision 239229) +++ gcc/fortran/trans-array.c (Arbeitskopie) @@ -6093,7 +6093,12 @@ return; } + loc.nextc = NULL; gfc_save_backend_locus (&loc); + /* loc.nextc is not set by save_backend_locus but the location routines + depend on it. */ + if (loc.nextc == NULL) + loc.nextc = loc.lb->line; gfc_set_backend_locus (&sym->declared_at); /* Descriptor type. */ Index: gcc/fortran/trans-decl.c =================================================================== --- gcc/fortran/trans-decl.c (Revision 239229) +++ gcc/fortran/trans-decl.c (Arbeitskopie) @@ -4050,6 +4050,8 @@ else if (proc_sym->as) { tree result = TREE_VALUE (current_fake_result_decl); + gfc_save_backend_locus (&loc); + gfc_set_backend_locus (&proc_sym->declared_at); gfc_trans_dummy_array_bias (proc_sym, result, block); /* An automatic character length, pointer array result. */ @@ -4059,8 +4061,6 @@ tmp = NULL; if (proc_sym->ts.deferred) { - gfc_save_backend_locus (&loc); - gfc_set_backend_locus (&proc_sym->declared_at); gfc_start_block (&init); tmp = gfc_null_and_pass_deferred_len (proc_sym, &init, &loc); gfc_add_init_cleanup (block, gfc_finish_block (&init), tmp); Index: gcc/testsuite/ChangeLog =================================================================== --- gcc/testsuite/ChangeLog (Revision 239229) +++ gcc/testsuite/ChangeLog (Arbeitskopie) @@ -1,3 +1,9 @@ +2016-07-25 Andre Vehreschild + + Backport from trunk: + PR fortran/70524 + * gfortran.dg/dependency_48.f90: New test. + 2016-08-07 Thomas Koenig PR fortran/71795 Index: gcc/testsuite/gfortran.dg/dependency_48.f90 =================================================================== --- gcc/testsuite/gfortran.dg/dependency_48.f90 (nicht existent) +++ gcc/testsuite/gfortran.dg/dependency_48.f90 (Arbeitskopie) @@ -0,0 +1,26 @@ +! { dg-do compile } +! { dg-options "-frepack-arrays -Warray-temporaries -O" } + +! Same as dependency_35 but with repack-arrays + +module foo + implicit none +contains + pure function bar(i,j) ! { dg-warning "Creating array temporary at \\(1\\)" } + integer, intent(in) :: i,j + integer, dimension(2,2) :: bar + bar = 33 + end function bar +end module foo + +program main + use foo + implicit none + integer a(2,2), b(2,2),c(2,2), d(2,2), e(2) + + read (*,*) b, c, d + a = matmul(b,c) + d + a = b + bar(3,4) + a = bar(3,4)*5 + b + e = sum(b,1) + 3 +end program main --MP_/TpIHDznz9.3XSVYY1v9CrJc Content-Type: text/x-patch Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=submit_gcc-5.diff Content-length: 3235 Index: gcc/fortran/ChangeLog =================================================================== --- gcc/fortran/ChangeLog (Revision 239230) +++ gcc/fortran/ChangeLog (Arbeitskopie) @@ -1,3 +1,12 @@ +2016-08-08 Andre Vehreschild + + Backport from trunk: + PR fortran/70524 + * trans-array.c (gfc_trans_dummy_array_bias): Ensure that the + location information is correctly set. + * trans-decl.c (gfc_trans_deferred_vars): Set the locus of the + current construct early. + 2016-07-29 Steven G. Kargl Thomas Koenig Index: gcc/fortran/trans-array.c =================================================================== --- gcc/fortran/trans-array.c (Revision 239230) +++ gcc/fortran/trans-array.c (Arbeitskopie) @@ -5928,7 +5928,12 @@ return; } + loc.nextc = NULL; gfc_save_backend_locus (&loc); + /* loc.nextc is not set by save_backend_locus but the location routines + depend on it. */ + if (loc.nextc == NULL) + loc.nextc = loc.lb->line; gfc_set_backend_locus (&sym->declared_at); /* Descriptor type. */ Index: gcc/fortran/trans-decl.c =================================================================== --- gcc/fortran/trans-decl.c (Revision 239230) +++ gcc/fortran/trans-decl.c (Arbeitskopie) @@ -3975,6 +3975,8 @@ else if (proc_sym->as) { tree result = TREE_VALUE (current_fake_result_decl); + gfc_save_backend_locus (&loc); + gfc_set_backend_locus (&proc_sym->declared_at); gfc_trans_dummy_array_bias (proc_sym, result, block); /* An automatic character length, pointer array result. */ @@ -3984,8 +3986,6 @@ tmp = NULL; if (proc_sym->ts.deferred) { - gfc_save_backend_locus (&loc); - gfc_set_backend_locus (&proc_sym->declared_at); gfc_start_block (&init); tmp = gfc_null_and_pass_deferred_len (proc_sym, &init, &loc); gfc_add_init_cleanup (block, gfc_finish_block (&init), tmp); Index: gcc/testsuite/ChangeLog =================================================================== --- gcc/testsuite/ChangeLog (Revision 239230) +++ gcc/testsuite/ChangeLog (Arbeitskopie) @@ -1,3 +1,9 @@ +2016-08-08 Andre Vehreschild + + Backport from trunk: + PR fortran/70524 + * gfortran.dg/dependency_48.f90: New test. + 2016-08-08 Thomas Koenig PR fortran/70040 Index: gcc/testsuite/gfortran.dg/dependency_48.f90 =================================================================== --- gcc/testsuite/gfortran.dg/dependency_48.f90 (nicht existent) +++ gcc/testsuite/gfortran.dg/dependency_48.f90 (Arbeitskopie) @@ -0,0 +1,26 @@ +! { dg-do compile } +! { dg-options "-frepack-arrays -Warray-temporaries -O" } + +! Same as dependency_35 but with repack-arrays + +module foo + implicit none +contains + pure function bar(i,j) ! { dg-warning "Creating array temporary at \\(1\\)" } + integer, intent(in) :: i,j + integer, dimension(2,2) :: bar + bar = 33 + end function bar +end module foo + +program main + use foo + implicit none + integer a(2,2), b(2,2),c(2,2), d(2,2), e(2) + + read (*,*) b, c, d + a = matmul(b,c) + d + a = b + bar(3,4) + a = bar(3,4)*5 + b + e = sum(b,1) + 3 +end program main --MP_/TpIHDznz9.3XSVYY1v9CrJc--