home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #16 / NN_1992_16.iso / spool / comp / sys / sgi / 11668 < prev    next >
Encoding:
Internet Message Format  |  1992-07-30  |  7.8 KB

  1. Path: sparky!uunet!paladin.american.edu!darwin.sura.net!jvnc.net!netnews.upenn.edu!a.chem.upenn.edu!yates
  2. From: yates@a.chem.upenn.edu (John H. Yates)
  3. Newsgroups: comp.sys.sgi
  4. Subject: 4.0.4 Fortran optimizer problem
  5. Message-ID: <84829@netnews.upenn.edu>
  6. Date: 30 Jul 92 16:00:10 GMT
  7. Sender: news@netnews.upenn.edu
  8. Organization: University of Pennsylvania
  9. Lines: 217
  10. Nntp-Posting-Host: a.chem.upenn.edu
  11. Originator: yates@a.chem.upenn.edu
  12.  
  13. One of my users has found what appears to be a problem with the
  14. optimizer in the f77 compiler at IRIX 4.0.4, f77 3.4.1 . It
  15. gives wrong results at -O2 and -O3. It works on IRIX 3.3 and
  16. f77 3.3 . It used a binary file input, so I hexified it so
  17. the test could be all in ASCII. Below is a shell archive
  18. containing the program, the hex input it reads, and a script
  19. called doit which shows the different answers for -O2 and -O3
  20. at IRIX 4.0.4 . I don't see anything obviously wrong with
  21. the Fortran.
  22.  
  23. What should I advise the user? 
  24.  
  25. Thanks, John
  26. yates@a.chem.upenn.edu
  27.  
  28. #! /bin/sh
  29. # This is a shell archive, meaning:
  30. # 1. Remove everything above the #! /bin/sh line.
  31. # 2. Save the resulting text in a file.
  32. # 3. Execute the file with /bin/sh (not csh) to create the files:
  33. #    bugger.f
  34. #    doit
  35. #    lcs_hex
  36. # This archive created: Thu Jul 30 11:48:34 1992
  37. export PATH; PATH=/bin:$PATH
  38. echo shar: extracting "'bugger.f'" '(1340 characters)'
  39. if test -f 'bugger.f'
  40. then
  41.     echo shar: will not over-write existing file "'bugger.f'"
  42. else
  43. sed 's/^    X//' << \SHAR_EOF > 'bugger.f'
  44.     X      program acid
  45.     X      implicit real*8 ( a-h, o-z )
  46.     X      integer*4 ihex_x(300)
  47.     X      integer*4 ihex_d(66)
  48.     X      common /x/ xx(50), yy(50), zz(50)
  49.     X      common /d/ dd2(33)
  50.     X      dimension xcp(17), ycp(17), zcp(17),
  51.     X     1 xhp(33), yhp(33), zhp(33),
  52.     X     1 rhpx(33), rhpy(33), rhpz(33),r2(33),
  53.     X     1 ncind(33)
  54.     X      equivalence(ihex_x(1),xx(1))
  55.     X      equivalence(ihex_d(1),dd2(1))
  56.     Xc
  57.     X      open(2, file = 'lcs_hex', form = 'formatted')
  58.     X      read(2,901) ihex_x,ihex_d
  59.     X 901  format(4Z10)
  60.     Xc      write(6,900)ihex_x,ihex_d
  61.     X 900  format(4Z10)
  62.     X
  63.     X         do m = 1, 16
  64.     X            ncind(2*m-1) = m+1
  65.     X            ncind(2*m) = m+1
  66.     X         enddo
  67.     X            ncind(33) = 17
  68.     X         do 1 j = 1 , 17
  69.     X            xcp(j) = xx(j)
  70.     X            ycp(j) = yy(j)
  71.     X            zcp(j) = zz(j)
  72.     X    1    continue
  73.     X         do 2 j = 1 , 33
  74.     X            xhp(j) = xx(17 + j)
  75.     X            yhp(j) = yy(17 + j)
  76.     X            zhp(j) = zz(17 + j)
  77.     X    2    continue
  78.     X            do 220 j = 1 , 33
  79.     X               rhpx(j) = xhp(j) - xcp(ncind(j))
  80.     X               rhpy(j) = yhp(j) - ycp(ncind(j))
  81.     X               rhpz(j) = zhp(j) - zcp(ncind(j))
  82.     X               r2(j) = rhpx(j)*rhpx(j) + rhpy(j)*rhpy(j)
  83.     X     1                 + rhpz(j)*rhpz(j) - dd2(j)
  84.     X  220       continue
  85.     X
  86.     X            do 221 j = 1 , 33
  87.     X  221       continue
  88.     Xc
  89.     X      write (6,*) j, sngl(r2(1)), sngl(r2(2))
  90.     X      end
  91. SHAR_EOF
  92. if test 1340 -ne "`wc -c < 'bugger.f'`"
  93. then
  94.     echo shar: error transmitting "'bugger.f'" '(should have been 1340 characters)'
  95. fi
  96. fi # end of overwriting check
  97. echo shar: extracting "'doit'" '(212 characters)'
  98. if test -f 'doit'
  99. then
  100.     echo shar: will not over-write existing file "'doit'"
  101. else
  102. sed 's/^    X//' << \SHAR_EOF > 'doit'
  103.     X#! /bin/csh -vf
  104.     X# compile and run bugger.f with different O options
  105.     Xf77 -O0 -o bugger bugger.f
  106.     Xbugger
  107.     X#
  108.     Xf77 -O1 -o bugger bugger.f
  109.     Xbugger
  110.     X#
  111.     Xf77 -O2 -o bugger bugger.f
  112.     Xbugger
  113.     X#
  114.     Xf77 -O3 -o bugger bugger.f
  115.     Xbugger
  116.     X#
  117. SHAR_EOF
  118. if test 212 -ne "`wc -c < 'doit'`"
  119. then
  120.     echo shar: error transmitting "'doit'" '(should have been 212 characters)'
  121. fi
  122. chmod +x 'doit'
  123. fi # end of overwriting check
  124. echo shar: extracting "'lcs_hex'" '(3752 characters)'
  125. if test -f 'lcs_hex'
  126. then
  127.     echo shar: will not over-write existing file "'lcs_hex'"
  128. else
  129. sed 's/^    X//' << \SHAR_EOF > 'lcs_hex'
  130.     X  BF308B0E   BEED8C8  3FDA7A51  57F76229
  131.     X  BFD7C486  4AA3C274  3FCAD8D2  6B8AC39C
  132.     X  BFE091A1  3780FC5E  3FCD1A9E  49350AF9
  133.     X  BFD45360  32F583CA  3FE23B2C  C68ED064
  134.     X  BF7667BC  FCE3AA06  3FE4756F  9CCDF706
  135.     X  BFB747D5   98C7E78  3FE86CD9   C31628C
  136.     X  3FAAB15B  A15C9D6C  3FEB83C0  655B9182
  137.     X  BFBBEA01   26F20E3  3FE74EB6  95B16C83
  138.     X  BFC3EA64  15F2A7B0  3FCDDA09  9E992DF6
  139.     X  3FF68F11  76BA99E0  BFC92E03  9FDEFF41
  140.     X  BFF63CC2  F74E0489  3FD10488  B555C5C8
  141.     X  3FF2E64B  1A9055F6  BFE043C0  2BA4AA88
  142.     X  BFF7EA2D  2A46091A  3FC803F1  FB48768D
  143.     X  3FF309D9  35B7EDCE  BFD00074  73973D6D
  144.     X  BFF4B43A  E9299B9A  3FE27AEE  3E802CB0
  145.     X  3FF85EB9  D4D1550F  3FB9A628  F1547DC6
  146.     X  BFF0B29C  D6644815  3FDE91AA  CE756546
  147.     X  3FF9978E  3E62E05C  BFC436C1  4DC20E48
  148.     X  BFF0E42F  D5C0E595  3FEC4329   2A8DE7E
  149.     X  3FFB1B20  2F0F82D0  BF8F7CA8  7E4185EC
  150.     X  BFEB9DCB  FC971755  3FF2C335  753C2B0A
  151.     X  3FFB3E72  47948C2A  BFD6B5DE  BB75F7C9
  152.     X  BFEF5198  970454F8  3FF1C31D  F32FD8B5
  153.     X  3FF86458  256610CD  BFF0963E  E4935ED7
  154.     X  3FD3FA3F   D0F0680  BFD99DA7  223D6344
  155.     X  BFB0FFE7  2C6EB00C  3FE4692E  C44CA600
  156.     X  3FFE83D0  919AC9DC  4002B738  66FBF4D5
  157.     X  400B2B87  A1D01656  400BD58D   6405FC4
  158.     X  40120672  1268920F  4011C9A4  191425A7
  159.     X  4015E8C5  B882BA50  4015EE37  71EF6877
  160.     X  401A7BEB   AF84612  401BC080  A164F770
  161.     X  401FF9AF  6134BE9D  40205CE1  AFC83D15
  162.     X  4021CBBD  25EED025  40220D09  EDA0ED1B
  163.     X  40230A9E  90AA37B1  BFB1D061  6B7C28AD
  164.     X  3FEA5D59  6DC24ADB  4005300F  9F56EC58
  165.     X  3FFAEE4D  3F6E9B9C  3FF75CFB  1B2D9790
  166.     X  4005A37C  37E919D4  40115B04  3A7397B7
  167.     X  40094F7D  D66FCBCF  40040CBB  E9DDD954
  168.     X  400DC8DC  45D3E704  4015B894  E38397D0
  169.     X  401110A9  881C4164  400C2815  FB9DB781
  170.     X  4012E6D3  E6A2FE98  4019AFC2  79DAF398
  171.     X  40153087  AF425FE7  401244B8  4EBA2F55
  172.     X  4016BFF3  83724F1B  401DD61C   10B7DD2
  173.     X  4019532E  9E0D616A  40185B0E  C6C7543A
  174.     X  401D6485  27C3A511  4021BD64  C0F18DB1
  175.     X  401E74A6  695BB187  401D227C  3DB8F1E5
  176.     X  40217ED3  1BCF6046  4023AC82  E085698C
  177.     X  4020BBE1  559280DA  4020204E   DF10781
  178.     X  40234FCE  2C8B7635  4021E432  1CDE48AF
  179.     X  4022E43E   32DAAF0  402508B9  9E3B2649
  180.     X  4003E8C1  19302AD3  401074DE  3B9133B4
  181.     X  40119B4B   A2756AD  40170B88  7889FFAA
  182.     X  401A3D60  1A603E6C  401F997B  BC89CDEE
  183.     X  4021C964  D9EA214C  40244BC3  581273A0
  184.     X  402642A8  18919A55  402906B0  81DABD3E
  185.     X  402A6217  BD722E71  402CD443  7533CD17
  186.     X  402E8A3C  D60247E2  40308AE8  2ABE3165
  187.     X  40317A6F  AE0AA0E5  4032BCF0  2C4A4363
  188.     X  4033DF2F   E3C3A9E  40134385  A5E9E347
  189.     X  40108E67  88314D38  400D8430  9C939A6E
  190.     X  4011D9E5  A750B991  40195E6B  FFBBA781
  191.     X  40168233  DC225879  40183401  69D5ABD3
  192.     X  401AD5F8  21BCA81B  4020A54D  DB6028A5
  193.     X  401EB4A5  E353C9ED  4020F19C  40689B67
  194.     X  402260E8  A28CA166  40252591  27FAB59C
  195.     X  4023C686  EBF4231D  4025795D   8895BB6
  196.     X  4026819E  97FB56A9  4029FF2F  C9194460
  197.     X  4028EE6B  6D157AD4  40291981  2F9F2F8A
  198.     X  402AE035  ECE2C872  402DFA56  34FF9FBC
  199.     X  402C255D  98AA718C  402D8E03  3A147AA8
  200.     X  402EFB9C  101B7751  4030FA8D  2392E4DB
  201.     X  403062EF  9B2ACF99  403119F6  19DBADF2
  202.     X  40319AD4  A7B95C21  4032FE47  33EC8838
  203.     X  40329CBB  1F723226  4033DF0D  14EBB4A6
  204.     X  4034C0B6   5585199  4033B027  84F07692
  205.     X  3FF14E3B  CD35A859  3FF14E3B  CD35A859
  206.     X  3FF14E3B  CD35A859  3FF14E3B  CD35A859
  207.     X  3FF14E3B  CD35A859  3FF14E3B  CD35A859
  208.     X  3FF14E3B  CD35A859  3FF14E3B  CD35A859
  209.     X  3FF14E3B  CD35A859  3FF14E3B  CD35A859
  210.     X  3FF14E3B  CD35A859  3FF14E3B  CD35A859
  211.     X  3FF14E3B  CD35A859  3FF14E3B  CD35A859
  212.     X  3FF14E3B  CD35A859  3FF14E3B  CD35A859
  213.     X  3FF14E3B  CD35A859  3FF14E3B  CD35A859
  214.     X  3FF14E3B  CD35A859  3FF14E3B  CD35A859
  215.     X  3FF14E3B  CD35A859  3FF14E3B  CD35A859
  216.     X  3FF14E3B  CD35A859  3FF14E3B  CD35A859
  217.     X  3FF14E3B  CD35A859  3FF14E3B  CD35A859
  218.     X  3FF14E3B  CD35A859  3FF14E3B  CD35A859
  219.     X  3FF14E3B  CD35A859  3FF14E3B  CD35A859
  220.     X  3FF14E3B  CD35A859  3FF14E3B  CD35A859
  221.     X  3FF14E3B  CD35A859
  222. SHAR_EOF
  223. if test 3752 -ne "`wc -c < 'lcs_hex'`"
  224. then
  225.     echo shar: error transmitting "'lcs_hex'" '(should have been 3752 characters)'
  226. fi
  227. fi # end of overwriting check
  228. #    End of shell archive
  229. exit 0
  230.