From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 9753 invoked by alias); 23 Jul 2012 12:54:39 -0000 Received: (qmail 9703 invoked by uid 22791); 23 Jul 2012 12:54:37 -0000 X-SWARE-Spam-Status: No, hits=-4.3 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00,KHOP_THREADED,TW_VB 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; Mon, 23 Jul 2012 12:54:24 +0000 From: "vbyakovl23 at gmail dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug middle-end/53616] [4.8 Regression] 416.gamess in SPEC CPU 2006 miscompiled Date: Mon, 23 Jul 2012 12:54:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: middle-end X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: vbyakovl23 at gmail dot com X-Bugzilla-Status: NEW X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: rguenth at gcc dot gnu.org X-Bugzilla-Target-Milestone: 4.8.0 X-Bugzilla-Changed-Fields: CC Message-ID: In-Reply-To: References: 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-07/txt/msg01791.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53616 Vladimir Yakovlev changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |vbyakovl23 at gmail dot com --- Comment #11 from Vladimir Yakovlev 2012-07-23 12:53:13 UTC --- Miscompare in 416 .games is caused by a wrong transformation of a loop in file grd2b.f, lines 113-121. DO 110 M=1,3 P12(M,1)= C(M,IAT) P12(M,2)= C(M,JAT) P12(M,3)= P12(M,2)-P12(M,1) R12= R12+P12(M,3)*P12(M,3) P34(M,1)= C(M,KAT) P34(M,2)= C(M,LAT) P34(M,3)= P34(M,2)-P34(M,1) 110 R34= R34+P34(M,3)*P34(M,3) After transformation we have P12(:,1) = C(:,IAT) P12(:,2) = C(:,jAT) DO 110 M=1,3 P12(M,3)= P12(M,2)-P12(M,1) R12= R12+P12(M,3)*P12(M,3) P34(M,3)= P34(M,2)-P34(M,1) 110 R34= R34+P34(M,3)*P34(M,3) P34(:,1) = C(:,KAT) P34(:,2) = C(:,LAT) That is we changed order of operators in the loop. Right transformation should be P12(:,1) = C(:,IAT) P12(:,2) = C(:,jAT) DO 110 M=1,3 P12(M,3)= P12(M,2)-P12(M,1) 110 R12= R12+P12(M,3)*P12(M,3) P34(:,1) = C(:,KAT) P34(:,2) = C(:,LAT) DO 111 M=1,3 P34(M,3)= P34(M,2)-P34(M,1) 111 R34= R34+P34(M,3)*P34(M,3) I attached a reduced test case and dumps with and without transformations. Command line to compile is gfortran m.f t.f -O3 The result of run is differed from a result of code compiled with -O0 opt level. I used compiler Target: x86_64-unknown-linux-gnu Configured with: ../gcc/configure --with-arch=corei7 --with-cpu=corei7 --enable-clocale=gnu --with-system-zlib --enable-shared --with-demangler-in-ld --enable-cloog-backend=isl --with-fpmath=sse --enable-languages=c,c++,fortran --enable-bootstrap=no Thread model: posix gcc version 4.8.0 20120606 (experimental) (GCC)