🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: net.lang.c
Article #9325

Re: Bug in 4.2 cc code generator (result type of assignment)

#9325
From: Guy Harris
Date: Wed, 17 Sep 1986 20:23
39 lines
1373 bytes
Fixed - in part - in 4.3.  The code it generates for the first loop, for
comparison; it's the same as in 4.2:

L19:
	cvtbl	*-12(fp),r0
	bicl2	$-256,r0
	cvtlb	r0,-13(fp)
	incl	-12(fp)
	cmpb	-13(fp),-5(fp)
	jeql	L20

And the code for the second loop:

L24:
	movl	-12(fp),r0
	incl	-12(fp)
	cvtbl	(r0),r0
	bicl2	$-256,r0
	cvtlb	r0,-13(fp)
	cmpb	-13(fp),-5(fp)
	jeql	L25

Well, at least it's correct this time, but it's *still* less efficient; moving
the pointer into "r0" first is pointless.  Turning on the optimizer doesn't
help; it does collapse the "cvtbl" and "bicl2" into a "movzbl", but it
doesn't figure out that

	movl	-12(fp),r0
	incl	-12(fp)
	movzbl	(r0),r0

is better done as

	movzbl	*-12(fp),r0
	incl	-12(fp)
-- 
	Guy Harris
	{ihnp4, decvax, seismo, decwrl, ...}!sun!guy
	guy@sun.com (or guy@sun.arpa)
Technical Details
Message-ID: <7367@sun.uucp>
Path: arc1-ca.pugleaf.net!utzoo!mnetor!seismo!lll-crg!nike!oliveb!glacier!decwrl!sun!guy
References: <3150@watmath.UUCP>

Show Full Headers
Complete Article Headers
Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP
Path: arc1-ca.pugleaf.net!utzoo!mnetor!seismo!lll-crg!nike!oliveb!glacier!decwrl!sun!guy
From: guy@sun.uucp (Guy Harris)
Newsgroups: net.lang.c
Subject: Re: Bug in 4.2 cc code generator (result type of assignment)
Message-ID: <7367@sun.uucp>
Date: Wed, 17-Sep-86 16:23:19 EDT
Article-I.D.: sun.7367
Posted: Wed Sep 17 16:23:19 1986
Date-Received: Fri, 19-Sep-86 22:45:51 EDT
References: <3150@watmath.UUCP>
Distribution: net
Organization: Sun Microsystems, Inc.
Lines: 39