Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!seismo!mimsy!cvl!umd5!zben From: zben@umd5 (Ben Cranston) Newsgroups: comp.org.decus,comp.lang.fortran,comp.lang.misc Subject: Re: better ratfor ? Message-ID: <1374@umd5> Date: Mon, 24-Nov-86 00:16:45 EST Article-I.D.: umd5.1374 Posted: Mon Nov 24 00:16:45 1986 Date-Received: Mon, 24-Nov-86 21:11:27 EST References: <1724@ncoast.UUCP> Reply-To: zben@umd5.umd.edu (Ben Cranston) Organization: University of Maryland, College Park Lines: 26 Keywords: ratfor, fortran, optimize, f77 Summary: Why not add optimization to f77... Xref: mnetor comp.org.decus:14 comp.lang.fortran:11 comp.lang.misc:12 In article <1724@ncoast.UUCP> btb@ncoast.UUCP (Brad Banko) writes: > As an example, the ratfor for loop: > for (i=1; i<=n; i = i + 1) >translates into the horrible: > i = 1 > if (.not. (i .le. n)) goto (end of loop) > ... > i = i + 1 (goto if) > (end of loop) > rather than into the much more efficient: > i = 1 > if (i .gt. n) goto (end of loop) > ... > i = i + 1 (etc.) > (end of loop) Gosh, any Fortran compiler that doesn't produce the same or similar code for these two cases sure seems suspect - are you sure there isn't an "optimize" switch that you could invoke? -- umd5.UUCP <= {seismo!umcp-cs,ihnp4!rlgvax}!cvl!umd5!zben Ben Cranston zben @ umd2.UMD.EDU Kingdom of Merryland Sperrows 1100/92 umd2.BITNET "via HASP with RSCS"