public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "vbyakovl23 at gmail dot com" <gcc-bugzilla@gcc.gnu.org>
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	[thread overview]
Message-ID: <bug-53616-4-2Ou95EnrQU@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-53616-4@http.gcc.gnu.org/bugzilla/>

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53616

Vladimir Yakovlev <vbyakovl23 at gmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |vbyakovl23 at gmail dot com

--- Comment #11 from Vladimir Yakovlev <vbyakovl23 at gmail dot com> 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)


  parent reply	other threads:[~2012-07-23 12:54 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-06-08 17:19 [Bug middle-end/53616] New: " hjl.tools at gmail dot com
2012-06-08 22:15 ` [Bug middle-end/53616] " hjl.tools at gmail dot com
2012-06-11  9:48 ` rguenth at gcc dot gnu.org
2012-06-11 13:59 ` rguenth at gcc dot gnu.org
2012-06-12 12:30 ` rguenth at gcc dot gnu.org
2012-06-12 13:04 ` hjl.tools at gmail dot com
2012-06-12 13:07 ` hjl.tools at gmail dot com
2012-06-12 14:06 ` rguenth at gcc dot gnu.org
2012-06-14 13:02 ` rguenth at gcc dot gnu.org
2012-06-27 19:13 ` pthaugen at gcc dot gnu.org
2012-06-28  8:27 ` rguenther at suse dot de
2012-07-23 12:50 ` vbyakovl23 at gmail dot com
2012-07-23 12:54 ` vbyakovl23 at gmail dot com [this message]
2012-07-23 13:30 ` rguenth at gcc dot gnu.org
2012-07-24  8:39 ` rguenth at gcc dot gnu.org
2012-07-24  9:06 ` rguenth at gcc dot gnu.org
2012-07-24 15:37 ` vbyakovl23 at gmail dot com

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-53616-4-2Ou95EnrQU@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).