Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!ames!sgi!shinobu!odin!dinkum!calvin From: calvin@dinkum.sgi.com (Calvin H. Vu) Newsgroups: comp.sys.mips Subject: Re: f77 bug Message-ID: <3482@odin.SGI.COM> Date: 1 Feb 90 23:01:58 GMT References: <1990Feb1.170639.15889@sobmips.UUCP> Sender: news@odin.SGI.COM Lines: 69 In article <1990Feb1.170639.15889@sobmips.UUCP> laporte@sobmips.UUCP (p.laporte) writes: >We have found what we think is a bug in the fortran compiler (version 2.0) >Here is a small program that demonstrate the problem. When we use the >optimiser we get incorrect results when doing a simple addition. This is what I got (everything compiled with -O2): MIPS 1.21 release: R(4)= 4.00000 R(5)= 1.00000 R(6)= 2.00000 R(7)= 3.00000 R(5)+R(6)= 2.00000 R(5)+R(7)= 4.00000 R(5)+R(6)+R(7)= 5.00000 R(5)+R(6)= 2.00000 R(5)+R(7)= 4.00000 R(5)+R(6)+R(7)= 5.00000 MIPS 1.31 release: (original) R(4)= 4.00000 R(5)= 2.00000 R(6)= 0.00000 R(7)= 3.00000 R(5)+R(6)= 4.00000 R(5)+R(7)= 5.00000 R(5)+R(6)+R(7)= 7.00000 R(5)+R(6)= 4.00000 R(5)+R(7)= 5.00000 R(5)+R(6)+R(7)= 7.00000 MIPS 1.31 release: (modified - SGI 3.2 release) R(4)= 4.00000 R(5)= 1.00000 R(6)= 2.00000 R(7)= 3.00000 R(5)+R(6)= 3.00000 R(5)+R(7)= 4.00000 R(5)+R(6)+R(7)= 6.00000 R(5)+R(6)= 3.00000 R(5)+R(7)= 4.00000 R(5)+R(6)+R(7)= 6.00000 All MIPS 2.0 releases (one original from MIPS and two SGI's souped up versions) give the correct results. So that leaves a question: Are you sure you have the MIPS 2.0 release of Fortran ? I remember they had a problem with register allocation in the assembler that was fixed in the 2.0 release. That is most likely the problem you ran into. Try to get the new assembler from MIPS if you can. I still don't know why you have this problem with your 2.0 release though since the plain-vanilla 2.0 release MIPS sent us no longer has this bug. Hmmmm, suddenly I realized that I had 7 versions of the Fortran compiler on my machine just for historical comparisons. >Pierre Laporte >{attcan,mcgill-vision,telly}!sobeco!laporte Calvin Vu