From patchwork Tue Sep 14 16:28:38 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Jan Hubicka X-Patchwork-Id: 64728 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]) by ozlabs.org (Postfix) with SMTP id 7A967B70A6 for ; Wed, 15 Sep 2010 02:29:16 +1000 (EST) Received: (qmail 25228 invoked by alias); 14 Sep 2010 16:29:14 -0000 Received: (qmail 25215 invoked by uid 22791); 14 Sep 2010 16:29:13 -0000 X-SWARE-Spam-Status: No, hits=-1.8 required=5.0 tests=AWL, BAYES_00, T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from nikam-dmz.ms.mff.cuni.cz (HELO nikam.ms.mff.cuni.cz) (195.113.20.16) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 14 Sep 2010 16:28:41 +0000 Received: by nikam.ms.mff.cuni.cz (Postfix, from userid 16202) id F15A49ACA85; Tue, 14 Sep 2010 18:28:38 +0200 (CEST) Date: Tue, 14 Sep 2010 18:28:38 +0200 From: Jan Hubicka To: Jakub Jelinek Cc: Andrew Pinski , Jan Hubicka , "H.J. Lu" , gcc-patches@gcc.gnu.org, rguenther@suse.de Subject: Re: Empty static constructor folding Message-ID: <20100914162838.GD22498@kam.mff.cuni.cz> References: <20100911232546.GC28272@kam.mff.cuni.cz> <20100913195541.GC22498@kam.mff.cuni.cz> <20100913201024.GD1269@tyan-ft48-01.lab.bos.redhat.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20100913201024.GD1269@tyan-ft48-01.lab.bos.redhat.com> User-Agent: Mutt/1.5.18 (2008-05-17) 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 > On Mon, Sep 13, 2010 at 01:04:45PM -0700, Andrew Pinski wrote: > > On Mon, Sep 13, 2010 at 12:55 PM, Jan Hubicka wrote: > > > It seems that those testcases just need some obstructation to avoid folding.  I wonder how I make varianble public in fortran? > > > > The easy way is to put the variables in a module and then do a "use > > module". Right now the variables in the program are really local to > > the function (either auto or static depending on the size of the array > > in this case they are huge so they are static). > > Or you can add > common // a, b, c > or > call fill (a, b) > with > subroutine fill(a, b) > integer, parameter :: kp = 4 > integer, parameter :: n = 2000 > complex(kp), dimension(n,n) :: a,b > a = 1 > b = 1 > end subroutine fill > or something similar. Thanks, I believe making them common is precisely what I want to get original behaviour. So I comitted the following. It fixed the testcase for me. Index: ChangeLog =================================================================== --- ChangeLog (revision 164281) +++ ChangeLog (working copy) @@ -1,3 +1,8 @@ +2010-09-14 Jan Hubicka + + * gfortran.dg/vect/fast-math-pr38968.f90: Add common to prevent + folding. + 2010-09-14 Jakub Jelinek PR middle-end/45567 Index: gfortran.dg/vect/fast-math-pr38968.f90 =================================================================== --- gfortran.dg/vect/fast-math-pr38968.f90 (revision 164250) +++ gfortran.dg/vect/fast-math-pr38968.f90 (working copy) @@ -10,6 +10,7 @@ program mymatmul complex(kp), dimension(n,n) :: a,b,c real :: t1, t2 integer :: i, j, k + common // a,b,c do j = 1, n do k = 1, n