Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.1 6/24/83; site utah-cs.UUCP Path: utzoo!watmath!clyde!burl!ulysses!allegra!mit-eddie!genrad!panda!talcott!harvard!seismo!utah-cs!donn From: donn@utah-cs.UUCP (Donn Seeley) Newsgroups: net.lang.f77,net.bugs.4bsd Subject: A speed improvement for recent versions of 4.2 BSD f77 Message-ID: <3325@utah-cs.UUCP> Date: Thu, 2-May-85 02:15:36 EDT Article-I.D.: utah-cs.3325 Posted: Thu May 2 02:15:36 1985 Date-Received: Fri, 3-May-85 23:48:25 EDT Organization: University of Utah CS Dept Lines: 52 Xref: watmath net.lang.f77:276 net.bugs.4bsd:1491 This fix should only apply to people with recent Berkeley or Utah versions of f77... At some point following the fix to shorten offsets to local data, a buglet crept into the compiler which can cause a severe speed penalty for f77 programs. This bug probably affects the vast majority of programs and it's rather important that it be repaired if you want to see any sort of performance from your f77 software. The problem is that data is sometimes only aligned to 16-bit boundaries instead of 32-bit boundaries. The VAX can fetch data from any alignment, but it is considerably more efficient to fetch 32-bit or larger data which is aligned to 32 bits. The program that led me to find this bug runs more than twice as fast when the bug is fixed... The fix is to make the code for the function putstr() in f77pass1/put.c agree with the comment that heads it. Here is a revised putstr(): ------------------------------------------------------------------------ /* * put out a character string constant. begin every one on * a long integer boundary, and pad with nulls */ putstr(fp, s, n) FILEP fp; register char *s; register int n; { int b[SZLONG]; register int i; i = 0; while(--n >= 0) { b[i++] = *s++; if(i == SZLONG) { prchars(fp, b); prchars(fp, b+SZSHORT); i = 0; } } while(i < SZLONG) b[i++] = '\0'; prchars(fp, b); prchars(fp, b+SZSHORT); } ------------------------------------------------------------------------ Donn Seeley University of Utah CS Dept donn@utah-cs.arpa 40 46' 6"N 111 50' 34"W (801) 581-5668 decvax!utah-cs!donn