public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/35659]  New: Miscompiled code with -O2 (but not with -O2 -funroll-loops) on ia64
@ 2008-03-21 18:49 kmccarty at debian dot org
  2008-03-22 13:22 ` [Bug target/35659] " rguenth at gcc dot gnu dot org
                   ` (28 more replies)
  0 siblings, 29 replies; 30+ messages in thread
From: kmccarty at debian dot org @ 2008-03-21 18:49 UTC (permalink / raw)
  To: gcc-bugs

Hi,

[This bug was initially submitted to the Debian BTS at
http://bugs.debian.org/466948 -- at the request of Debian's gcc maintainer, I
am also sending it here]

There is apparently a miscompilation of CERNLIB code in the "kernlib" library
on ia64 with gfortran-4.3 at optimization level -O2 or higher.  (Oddly,
compiling with -O2 -funroll-loops does not expose the problem, which is why I
didn't notice it earlier.)

I've verified that this problem occurs on ia64 with gfortran-4.3 versions
4.3-20080202-1, 4.3-20080219-1 and 4.3.0.  For the most recent trial:

(sid)kmccarty@merulo:~$ gfortran-4.3 -v
Using built-in specs.
Target: ia64-linux-gnu
Configured with: ../src/configure linux gnu
Thread model: posix
gcc version 4.3.1 20080309 (prerelease) (Debian 4.3.0-1)

Please see the complete test case I've provided at
http://people.debian.org/~kmccarty/tlsc-test-case.tar.gz

[Note, the files libkernlib.a and libkerngent.a in the tarball were compiled on
ia64 from CERNLIB source code, which is GPL; it is available from the Debian
source package of "cernlib" version 2006.dfsg.2-10]

[Note 2, I have updated this test case tarball to the gfortran version noted
above since I originally submitted this bug to the Debian BTS.]

The file tlsc.F in the test case is where the optimization bug happens.  I
saved files tlsc.f, tlsc.s and tlsc.o into subdirectories of the test case for
three different combinations of compile flags:

-O2 (causes miscompiled code) in obj-fail subdir

-O0 (seems fine)
-O2 -funroll-loops (seems fine) both in obj-success subdir.

Also the output of the test case, saved as output.txt in each subdir.

You can regenerate all of these files with these three combinations of compiler
flags quickly with "make output".

The presence or absence of -fno-automatic on the gfortran command line (I
omitted it in all three cases) appears to make no difference.

best regards,
Kevin McCarty


-- 
           Summary: Miscompiled code with -O2 (but not with -O2 -funroll-
                    loops) on ia64
           Product: gcc
           Version: 4.3.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: kmccarty at debian dot org
 GCC build triplet: ia64-linux-gnu
  GCC host triplet: ia64-linux-gnu
GCC target triplet: ia64-linux-gnu


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


^ permalink raw reply	[flat|nested] 30+ messages in thread

end of thread, other threads:[~2009-02-06  7:33 UTC | newest]

Thread overview: 30+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-03-21 18:49 [Bug fortran/35659] New: Miscompiled code with -O2 (but not with -O2 -funroll-loops) on ia64 kmccarty at debian dot org
2008-03-22 13:22 ` [Bug target/35659] " rguenth at gcc dot gnu dot org
2008-03-24 16:48 ` kmccarty at debian dot org
2008-03-24 17:33 ` [Bug target/35659] [4.3/4.4 Regression] " rguenth at gcc dot gnu dot org
2008-04-28  4:29 ` mmitchel at gcc dot gnu dot org
2008-05-20 21:02 ` sje at cup dot hp dot com
2008-05-21  3:51 ` kmccarty at debian dot org
2008-05-21 10:40 ` rguenth at gcc dot gnu dot org
2008-05-23  1:29 ` mmitchel at gcc dot gnu dot org
2008-06-03 18:00 ` sje at cup dot hp dot com
2008-06-04  9:00 ` rguenth at gcc dot gnu dot org
2008-06-06 15:03 ` rguenth at gcc dot gnu dot org
2008-06-24 14:45 ` jakub at gcc dot gnu dot org
2008-06-24 15:05 ` jakub at gcc dot gnu dot org
2008-06-25 10:21 ` jakub at gcc dot gnu dot org
2008-06-25 11:32 ` jakub at gcc dot gnu dot org
2008-06-25 11:33 ` jakub at gcc dot gnu dot org
2008-06-25 21:34 ` mkuvyrkov at gcc dot gnu dot org
2008-06-25 22:16 ` doko at cs dot tu-berlin dot de
2008-06-26  8:02 ` jakub at gcc dot gnu dot org
2008-06-26  8:42 ` jakub at gcc dot gnu dot org
2008-06-26  9:22 ` maxim at codesourcery dot com
2008-06-26  9:24 ` mkuvyrkov at gcc dot gnu dot org
2008-08-01 23:29 ` sje at cup dot hp dot com
2008-08-02 18:16 ` mkuvyrkov at gcc dot gnu dot org
2008-08-04 17:36 ` sje at cup dot hp dot com
2008-08-06  6:26 ` mkuvyrkov at gcc dot gnu dot org
2008-08-06  6:38 ` mkuvyrkov at gcc dot gnu dot org
2008-08-06  6:40 ` mkuvyrkov at gcc dot gnu dot org
2009-02-06  7:33 ` bonzini at gcc dot gnu dot org

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).