rogden@uceng.UC.EDU (rob ogden) (03/20/90)
Hello comp.sys.apollo, FORTRAN compiler bug DN10000: Here is a FORTRAN bug that was found on out dn10000 last week. There are ~560 lines in this email because the problem subroutine is attached. I heard this morning, 3/19/90, from Debbie Sahrbeck of Apollo. The work around is: compile with -save with the f77 ,unix command , this needs to be prefixed with -W0 example: f77 -W0,-save -c chrstf.f An Apollo Problem Report number has been assigned. APR# DE0CE - - - We have a DN10000 with FORTRAN v10.7.p Debbie Sahrbeck indicates that the problem does NOT show up on the 68000s. That which follows is the information sent to Debbie Sahrbeck. Rob Ogden, rogden@uceng.uc.edu uccba!uceng!rogden -------------------------------------------------------------- Hello Debbie Sahrbeck, sahrbeck_d@apollo.com I am Rob Ogden, rogden@uceng.uc.edu. The following information pertains to reference #A2015160 a FORTRAN compiler error. Attached is the subroutine chrstf. The compiler errors are shown. The following is a table of parameters . This works -> parameter (ngrd=1,imx=13,jmx=63,kmx=9) This does not work -> parameter (ngrd=1,imx=13,jmx=64,kmx=9) This does not work -> parameter (ngrd=1,imx=13,jmx=63,kmx=10) nasa.hm.ztst3d[80] f77 -c chrstf.f chrstf.f: ?(ftn) LIR_$BUILD_OPERAND - signed_immed16 out of range: 4294907296, ADD Compiler backend failure while processing routine "chrstf" ?(ftn) All routines processed by backend - aborting due to previous errors (00594) end **** Error #319 on Line 594: System fault trapped, fault message follows: status 7F000000 Apollo-specific fault Compiler error in file chrstf.f: see a system manager nasa.hm.ztst3d[81] nasa.hm.ztst3d[81] nasa.hm.ztst3d[81] f77 -O -c chrstf.f chrstf.f: **** Informational #929 on Line 35: Assignment eliminated, value never used: ybody **** Informational #929 on Line 29: Assignment eliminated, value never used: dfdx **** Informational #929 on Line 21: Assignment eliminated, value never used: dfdx **** Informational #929 on Line 20: Assignment eliminated, value never used: fofx **** Informational #929 on Line 19: Assignment eliminated, value never used: ybody **** Informational #929 on Line 17: Assignment eliminated, value never used: yny ?(ftn) LIR_$BUILD_OPERAND - signed_immed16 out of range: 4294907296, ADD Compiler backend failure while processing routine "chrstf" ?(ftn) All routines processed by backend - aborting due to previous errors (00594) end **** Error #319 System fault trapped, fault message follows: status 7F000000 Apollo-specific fault Compiler error in file chrstf.f: see a system manager nasa.hm.ztst3d[82] nasa.hm.ztst3d[82] nasa.hm.ztst3d[82] /com/sh $ $ ftn chrstf.ftn **** Informational #929 on Line 35: Assignment eliminated, value never used: ybody **** Informational #929 on Line 29: Assignment eliminated, value never used: dfdx **** Informational #929 on Line 21: Assignment eliminated, value never used: dfdx **** Informational #929 on Line 20: Assignment eliminated, value never used: fofx **** Informational #929 on Line 19: Assignment eliminated, value never used: ybody **** Informational #929 on Line 17: Assignment eliminated, value never used: yny ?(ftn) LIR_$BUILD_OPERAND - signed_immed16 out of range: 4294907296, ADD Compiler backend failure while processing routine "chrstf" ?(ftn) All routines processed by backend - aborting due to previous errors (00594) end **** Error #319 System fault trapped, fault message follows: status 7F000000 ?(sh) "/com/ftn" - status 7F000000 $ THE SUBROUTINE STARTS HERE. --------------------------- please note the parameter statement, the third line in the subroutine. The following is a table of parameter statements that have been tried. This works -> parameter (ngrd=1,imx=13,jmx=63,kmx=9) This does not work -> parameter (ngrd=1,imx=13,jmx=64,kmx=9) This does not work -> parameter (ngrd=1,imx=13,jmx=63,kmx=10) ----------------------------------- subroutine chrstf (ip,i) c implicit real*8(a-h,o-z) parameter (ngrd=1,imx=13,jmx=64,kmx=9) common /grsz/ nx,ny,nz,nw,ns common /grid/ x(imx),y(0:jmx+1),z(0:kmx+1) 1 ,hx(imx),hy(0:jmx+1),hz(0:kmx+1) common /coords/ xp(0:jmx+1,0:kmx+1,3),yp(0:jmx+1,0:kmx+1,3) 1 ,zp(0:jmx+1,0:kmx+1,3) common /metten/ sqrg(jmx,kmx,2),gv11(jmx,kmx),gv12(jmx,kmx) 1 ,gv13(jmx,kmx),gv22(jmx,kmx),gv23(jmx,kmx) 2 ,gv33(jmx,kmx),gn11(jmx,kmx,2),gn12(jmx,kmx,2) 3 ,gn13(jmx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