Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP
Posting-Version: version B 2.10.2 9/18/84; site rlgvax.UUCP
Path: utzoo!linus!philabs!cmcl2!seismo!rlgvax!guy
From: guy@rlgvax.UUCP (Guy Harris)
Newsgroups: net.bugs.4bsd
Subject: Re: bug in cc optimizer
Message-ID: <157@rlgvax.UUCP>
Date: Sun, 30-Sep-84 03:03:25 EDT
Article-I.D.: rlgvax.157
Posted: Sun Sep 30 03:03:25 1984
Date-Received: Tue, 2-Oct-84 03:31:37 EDT
References: <291@hercules.UUCP> <165@umcp-cs.UUCP>
Organization: CCI Office Systems Group, Reston, VA
Lines: 32

> (Does this REALLY need to go to net.lang.c?  Oh well...)  Guy Harris
> posted a fix for this one long ago.  It seems that Berkeley never
> picked up the fix since the bug is still there in the 4.2BSD /lib/c2.
> Here's RCS diffs.  (Thanks, Guy.)

That diff listing actually includes about 3 bug fixes.  To be fair, the only
one that's actually mine is the one which keeps the optimizer from merging

	cvtwl	(r11)+,r0
	movzbl	r0,r0

into

	movzbl	(r11)+,r0

which sequence gets generated by code like

	register short *sp;
	register int c;

	c = (*sp++)&0377;

The other fixes are the one to the "extzv" instructions, and one that kept
the compiler from merging floating and non-floating convert instructions.

I'm told lots of other fixes posted to net.bugs.4bsd but not mailed to
4bsd-bugs@berkeley haven't been picked up by Berkeley yet.  These bugs exist
in the System III version of the optimizer as well, and some of them might
even still be around in System V Release 2.

	Guy Harris
	{seismo,ihnp4,allegra}!rlgvax!guy