Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!brutus.cs.uiuc.edu!wuarchive!wugate!wucs1!berkley From: berkley@wucs1.wustl.edu (Berkley Shands) Newsgroups: comp.sys.mips Subject: Mips Fortran Bugs Keywords: Fortran, Bugs, MIPS Message-ID: <938@wucs1.wustl.edu> Date: 28 Jul 89 14:30:19 GMT Organization: Washington University, St. Louis, MO Lines: 39 In porting a LARGE fortran package to a MIPS based engine, (the decstation 3100 + the IRIS 4d power series) I ran across the following nasty bugs... 1) The compiler (with standard optimization) will optimize away identical argument lists to subroutine calls WHEN The calls follow each other using the EXACT SAME list, and the first argument is an array or a character string. call foo(a,b,c) call zor(a,b,c) The "a" argument is stack bound, but the data is trashed. It usually is a small fixed constant. The cure is to vary the argument list so it is not re-used by the compiler. 2) END=nn,ERR=NN on READS are really random branch statements. 3) The format (L2) logical format, variable length, fixed size fields works on OUTPUT. On Input, that read and all subsequent reads will return NULLS or EOF. 4) The compiler is VERY picky about ENTRY statements. All entry points to a function/subroutine must share the SAME TYPE and ARGUMENT LISTS. 5) The runtime system (iris 4d this time) can lose file position on reads if to much I/O is done on consecutive i/o chanels (unit=1,unit=2...) 6) Passing character strings as arguments when the string is $INCLUDED and in common will sometimes pass trash or nulls. The larger the compilation unit, the worse the trouble. I hope this helps anyone trying to port VAX fortran to these noce FAST engines! Berkley Shands BERKLEY.WUSTL.EDU (BITNET) DECUS VAX SIG Exec