From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 22622 invoked by alias); 3 Mar 2012 20:00:55 -0000 Received: (qmail 22614 invoked by uid 22791); 3 Mar 2012 20:00:54 -0000 X-SWARE-Spam-Status: No, hits=-2.8 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00,TW_VD,TW_YZ X-Spam-Check-By: sourceware.org Received: from localhost (HELO gcc.gnu.org) (127.0.0.1) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Sat, 03 Mar 2012 20:00:41 +0000 From: "burnus at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug fortran/52473] New: CSHIFT slow - inline it? Date: Sat, 03 Mar 2012 20:00:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: fortran X-Bugzilla-Keywords: missed-optimization X-Bugzilla-Severity: normal X-Bugzilla-Who: burnus at gcc dot gnu.org X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Changed-Fields: Message-ID: X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated Content-Type: text/plain; charset="UTF-8" MIME-Version: 1.0 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org X-SW-Source: 2012-03/txt/msg00309.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52473 Bug #: 52473 Summary: CSHIFT slow - inline it? Classification: Unclassified Product: gcc Version: 4.7.0 Status: UNCONFIRMED Keywords: missed-optimization Severity: normal Priority: P3 Component: fortran AssignedTo: unassigned@gcc.gnu.org ReportedBy: burnus@gcc.gnu.org For the program http://www.cita.utoronto.ca/~pen/MHD/mhd.f90 GCC produces relatively slow code: $ gfortran -Ofast mhd.f90; time ./a.out > /dev/null real 0m0.534s $ pathf95 -O3 mhd.f90; time ./a.out > /dev/null real 0m0.169s Which is 3.2 times faster. A closer analyis shows that it is sufficient to compile the functions advectbyzx, tvd1 and tvdb with pathf95 to gain the same speed. If one only compiles advectbyzx and tvd1 (and the rest with gfortran) the speed is 0m0.301s. The performance difference seems to be due to the calls to _gfortran_cshift0_4. Expected: CSHIFT should be inlined (at least for a scalar SHIFT) - as pathf95 and ifort do. * * * 13.7.43 CSHIFT (ARRAY, SHIFT [, DIM]) Description. Circular shift of an array.Description. Circular shift of an array.