[Search for users] [Overall Top Noters] [List of all Conferences] [Download this site]

Conference turris::fortran

Title:Digital Fortran
Notice:Read notes 1.* for important information
Moderator:QUARK::LIONEL
Created:Thu Jun 01 1995
Last Modified:Fri Jun 06 1997
Last Successful Update:Fri Jun 06 1997
Number of topics:1333
Total number of notes:6734

1222.0. "-transform_loops bug from Internet" by GEMGRP::GROVE () Mon Mar 17 1997 08:25

    Steve Hobbs passed along a FORTRAN (GEM) bug from the Internet.
    I compiled it with GEM's current BL33 sources, and it works OK
    at both -O4 and -O5. The FORTRAN team should check that it is
    fixed in V4.1 or some other released version.
    
    Thanks
    /Rich
    
From:	STEVEN::hobbs "Steven Hobbs" 14-MAR-1997 18:58
To:	craig@DEC:.steven, pieper@DEC:.steven, noyce@DEC:.steven, liu@DEC:.steven
CC:	grove@DEC:.steven
Subj:	bug in Digital Fortran 77 V4.0 for UNIX Alpha Systems (-transform_loops) - comp.unix.osf.osf1 #20805

In article <[email protected]>, Stefan Rombouts <[email protected]> writes:
There is a bug in the Digital Fortran 77 compiler V4.0 for UNIX Alpha
Systems: the following program does goes wrong if it is compiled with
the optimalization option -transform_loops (and thus also with -O5):


      PROGRAM fortranbug
C     bug in the fortran compiler 
C     compilation  with -O5 gives a different result than -O4
      REAL X(8,8)
      T1=9.
      X(6,1)=0.0
      T2=1.
      T3=2.
      DO K=2,5
         T4=T2+T3
         T5=T2*T3
         T6=SQRT(T2**2+T1)
         X(1,K)=T1
         X(2,K)=T2
         X(3,K)=T3
         T7=T2*SQRT(T3**2+T1)
         X(4,K)=T7
         X(5,K)=T3
         X(6,K)=X(6,k-1)+T7
         T2=T2+1.
         T3=T3+1.
      ENDDO
      WRITE(6,*) 'result:',X(6,5)
      DO I=2,5
         WRITE(6,'(5F12.6)') (X(J,I),J=1,5)
      ENDDO
      END  
	   
   /o\ |+\     Stefan Rombouts          		                  
   \_  | /     Institute for nuclear sciences   Tel. +32 (0)9/264 65 41  
     \ |\      RUG - Universiteit Gent          Fax. +32 (0)9/264 66 99 
   \_/ | \     Proeftuinstraat 86 ; B-9000 Gent ; Belgium

gemeun.zko.dec.com> pf77 -O4 bug.f -o bugo4
gemeun.zko.dec.com> pf77 -O5 bug.f -o bugo5
gemeun.zko.dec.com> bugo4
 result:   50.41464
    9.000000    1.000000    2.000000    3.605551    2.000000
    9.000000    2.000000    3.000000    8.485281    3.000000
    9.000000    3.000000    4.000000   15.000000    4.000000
    9.000000    4.000000    5.000000   23.323807    5.000000
gemeun.zko.dec.com> bugo5
 result:   50.41464
    9.000000    1.000000    2.000000    3.605551    2.000000
    9.000000    2.000000    3.000000    8.485281    3.000000
    9.000000    3.000000    4.000000   15.000000    4.000000
    9.000000    4.000000    5.000000   23.323807    5.000000
T.RTitleUserPersonal
Name
DateLines
1222.1Looks fixedTLE::EKLUNDAlways smiling on the inside!Mon Mar 17 1997 09:2012
    	While DFA400 gives different results, DFA401 and DFA410
    both give the answers you did.  Seems to have been OK for a
    while.
    
    Cheers!
    Dave Eklund
    
    PS You may continue to discount the value of random postings
    on the internet...
    
    Dave E
    
1222.2QUARK::LIONELFree advice is worth every centMon Mar 17 1997 09:423
I replied to the newsgroup posting.

		Steve