Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP
Posting-Version: version B 2.10 beta 3/9/83; site sdcrdcf.UUCP
Path: utzoo!watmath!clyde!floyd!harpo!seismo!hao!hplabs!sdcrdcf!jlilien
From: jlilien@sdcrdcf.UUCP (Joel Lilienkamp)
Newsgroups: net.micro.68k
Subject: MIT 68K C Compiler bug fix
Message-ID: <860@sdcrdcf.UUCP>
Date: Wed, 22-Feb-84 14:09:46 EST
Article-I.D.: sdcrdcf.860
Posted: Wed Feb 22 14:09:46 1984
Date-Received: Fri, 24-Feb-84 01:07:04 EST
Reply-To: jlilien@sdcrdcf.UUCP (Joel Lilienkamp)
Organization: System Development Corporation, Santa Monica
Lines: 31


I worked on the MIT 68K C Compiler when I was at MIT Lincoln Laboratory.
The version of the compiler I have may be slightly out of date, although
I suspect that the fix I list here would not have to be changed much.

The bug in the compiler can be fixed by adding one additional entry in
table.c.  The offending entry in the table is near the beginning, and
looks something like this.

ASSIGN,	INAREG|FOREFF|FORCC,
	EAA,	TSCALAR|TFLOAT,
	EA,	TSCALAR|TFLOAT,
		0,	RLEFT|RRIGHT|RESCC,
		"\tmovZB\tAR,AL\t;\n",

The bug can be fixed by adding the following entry immediately before it.

ASSIGN,	INAREG|FOREFF|FORCC,
	EAA,	TCHAR,
	SBREG|STBREG,	TCHAR,
		NAREG|NASR,	RLEFT|RRIGHT|RESCC,
		"\tmovl\tAR,A1\n\tmovZB\tA1,AL\t;\n",

Purists may want to change the EA in the third row of the original entry
to EAA, but since the table is sorted linearly, it should make little
difference.  Do your own thing.

While this fixes the example problem, I have not tested throughly, nor
have I looked for bizarre side effects.  I only hacked around for a half
hour or so.
	Joel