This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: bug in g77 -O2 optimization found -- resending with attachment


Jonathan DeSena wrote:

> I downloaded gcc from CVS and (after much aggravation due to errors in
> the objective c part and the install of cpp.info and gcc.info) I was
> able to test the case with g77 version 2.95.3 20010101.  This solved the
> problem: the output was as it should be.  I assume this will also be the
> case in the next release.
> 
> Still, it bothers me a little that the problem "went away" without being
> addressed directly (though I suppose I do not know this for sure).  Is
> it possible that the symptom was cured while the underlying cause
> remains?  I guess it would just "feel better" to know why the problem
> occurred in the first place.  In any case, thanks for your quick
> response and attention to the issue.

I do agree this sounds fishy - however, in the move from 2.95.2 towards
2.95.3 some improvements to loop code (including induction variable
handling, which I and I1 certainly are) were made.

I assume these are responsible for the fix.

toon@laptop:~/g77-bugs$ /usr/bin/g77 -O2 -v desena.f
g77 version 2.95.2 20000220 (Debian GNU/Linux) (from FSF-g77 version
0.5.25 19991030 (prerelease))
Driving: /usr/bin/g77 -O2 -v desena.f -lg2c -lm
Reading specs from /usr/lib/gcc-lib/i386-linux/2.95.2/specs
gcc version 2.95.2 20000220 (Debian GNU/Linux)
 /usr/lib/gcc-lib/i386-linux/2.95.2/f771 desena.f -quiet -dumpbase
desena.f -O2 -version -fversion -o /tmp/cc9M6RaO.s
GNU F77 version 2.95.2 20000220 (Debian GNU/Linux) (i386-linux) compiled
by GNU C version 2.95.2 20000220 (Debian GNU/Linux).
GNU Fortran Front End version 0.5.25 19991030 (prerelease)
 as -V -Qy -o /tmp/ccuLwwVV.o /tmp/cc9M6RaO.s
GNU assembler version 2.9.5 (i386-linux) using BFD version 2.9.5.0.37
 /usr/lib/gcc-lib/i386-linux/2.95.2/collect2 -m elf_i386 -dynamic-linker
/lib/ld-linux.so.2 /usr/lib/crt1.o /usr/lib/crti.o
/usr/lib/gcc-lib/i386-linux/2.95.2/crtbegin.o
-L/usr/lib/gcc-lib/i386-linux/2.95.2 /tmp/ccuLwwVV.o -lg2c -lm -lgcc -lc
-lgcc /usr/lib/gcc-lib/i386-linux/2.95.2/crtend.o /usr/lib/crtn.o
toon@laptop:~/g77-bugs$ ./a.out
 IF THESE TWO NUMBERS ARE EQUAL, THE CODE IS BAD:  60.  60.

vs.:

toon@laptop:~/g77-bugs$ /usr/local/bin/g77 -v -O2 desena.f
g77 version 2.95.3 20010101 (prerelease) (from FSF-g77 version 0.5.25
19991030 (prerelease))
Driving: /usr/local/bin/g77 -v -O2 desena.f -lg2c -lm
Reading specs from /usr/local/lib/gcc-lib/i686-pc-linux-gnu/2.95.3/specs
gcc version 2.95.3 20010101 (prerelease)
 /usr/local/lib/gcc-lib/i686-pc-linux-gnu/2.95.3/f771 desena.f -quiet
-dumpbase desena.f -O2 -version -fversion -o /tmp/cccWM9ui.s
GNU F77 version 2.95.3 20010101 (prerelease) (i686-pc-linux-gnu)
compiled by GNU C version 2.95.3 20010101 (prerelease).
GNU Fortran Front End version 0.5.25 19991030 (prerelease)
 as -V -Qy -o /tmp/ccgs6xTy.o /tmp/cccWM9ui.s
GNU assembler version 2.9.5 (i386-linux) using BFD version 2.9.5.0.37
 /usr/local/lib/gcc-lib/i686-pc-linux-gnu/2.95.3/collect2 -m elf_i386
-dynamic-linker /lib/ld-linux.so.2 /usr/lib/crt1.o /usr/lib/crti.o
/usr/local/lib/gcc-lib/i686-pc-linux-gnu/2.95.3/crtbegin.o
-L/usr/local/lib/gcc-lib/i686-pc-linux-gnu/2.95.3 -L/usr/local/lib
/tmp/ccgs6xTy.o -lg2c -lm -lgcc -lc -lgcc
/usr/local/lib/gcc-lib/i686-pc-linux-gnu/2.95.3/crtend.o /usr/lib/crtn.o
toon@laptop:~/g77-bugs$ ./a.out
 IF THESE TWO NUMBERS ARE EQUAL, THE CODE IS BAD:  50.  60.

-- 
Toon Moene - mailto:toon@moene.indiv.nluug.nl - phoneto: +31 346 214290
Saturnushof 14, 3738 XG  Maartensdijk, The Netherlands
Maintainer, GNU Fortran 77: http://gcc.gnu.org/onlinedocs/g77_news.html
Join GNU Fortran 95: http://g95.sourceforge.net/ (under construction)

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]