C compiler bug

Chris Torek chris at umcp-cs.UUCP
Mon Aug 27 06:13:25 AEST 1984


As long as we have people fixing bugs, how about someone patching up the
pcc/ code that converts RS into LS and negates the shift?  It fixes up
constants but it doesn't remove double negations.  Example:

	foo () { register int i,j,k; k = i >> -j; }

produces (prettified)

	.align	1
	.globl	_foo
_foo:	.word	0xe000
	mnegl	r10,r0
	mnegl	r0,r0
	ashl	r0,r11,r0
	movl	r0,r9
	ret

What's the idea of the double mnegl?  I got disgusted enough with this
(and other similar but tougher-to-optimize) stuff in the output stage of
my Versatec TeX filter that I stuck in asm()s (under #ifdef vax though).
-- 
In-Real-Life: Chris Torek, Univ of MD Comp Sci (301) 454-7690
UUCP:	{seismo,allegra,brl-bmd}!umcp-cs!chris
CSNet:	chris at umcp-cs		ARPA:	chris at maryland



More information about the Comp.lang.c mailing list