🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.gcc.bug
Article #912

Problems with generated assembly

#912
From: Longshot
Date: Wed, 24 Jan 1990 06:36
66 lines
2153 bytes
We are suddenly having problems with gcc. It was generating code that died
horribly when passed to as. We are running an Encore Multimax, with BSD4.3.
I tried to put together gnu-as, but it died even harder. Has it been tested
on a Multimax? It could handle almost nothing the the files. The alignment
maximum was set to 15 in read.c, when Encore's cc habitually generates
".align 16". Plus, it died on lines of the form ".dss <arglist>". So, for
laughs, I tried gcc -c append.c (from the gas distribution):

(The manifest is, of course, before this.)

/* JF:  This is silly.  Why not stuff this in some other file? */
#ifdef USG
#define bcopy(from,to,n) memcpy(to,from,n)
#endif

void
append (charPP, fromP, length)
char	**charPP;
char	*fromP;
unsigned long length;
{
	if (length) {		/* Don't trust bcopy() of 0 chars. */
		bcopy (fromP, * charPP,(int) length);
		*charPP += length;
	}
}

/* end: append.c */

{ uokmax:~ 1 } gcc -c append.c
Assembler: append.c
	aline 7	: illegal displacement field
	aline 20	: illegal displacement field

And the actual code, as generated by gcc -S append.c:

	.file	"append.c"
gcc_compiled.:
.text
	.align 16
.globl _append
_append:
	enter [],0			# line 7
	cmpqd $0,16(fp)
	beq .L2
	movd 16(fp),tos
	movd 0(8(fp)),tos
	movd 12(fp),tos
	bsr ?_bcopy
	movd 8(fp),r0
	addd 16(fp),0(r0)
	adjspb $-12
.L2:
.L1:
	exit []
	ret 0				# line 20



Randy

-- 
Randy J. Ray       University of Oklahoma, Norman Campus	(405)/325-5370
!chinet!uokmax!randy	randy@uokmax.uucp    randy@uokmax.ecn.uoknor.edu
"...and he who made kittens put snakes in the grass..."  -- Jethro Tull
-=*-=*-=*-=*-=*-=*-=*-=*-=*-=*-=*-=*-=*-=*-=*-=*-=*-=*-=*-=*-=*-=*-=*-=*-=*-=*
Technical Details
Message-ID: <9001240636.AA13677@uokmax.ecn.uoknor.edu>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!cs.utexas.edu!tut.cis.ohio-state.edu!UOKMAX.ECN.UOKNOR.EDU!randy

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!cs.utexas.edu!tut.cis.ohio-state.edu!UOKMAX.ECN.UOKNOR.EDU!randy
From: randy@UOKMAX.ECN.UOKNOR.EDU (Longshot)
Newsgroups: gnu.gcc.bug
Subject: Problems with generated assembly
Message-ID: <9001240636.AA13677@uokmax.ecn.uoknor.edu>
Date: 24 Jan 90 06:36:41 GMT
Sender: daemon@tut.cis.ohio-state.edu
Distribution: gnu
Organization: GNUs Not Usenet
Lines: 66