[comp.os.minix] Problem Compiling PD-Tar

frank@morgan.com (Frank Wortner) (04/09/88)

This is probably mostly for the authors of the Minix C compiler (are
you out there, Andy & Co? :-)), but others familiar with it may be
able to help.

I've been trying to compile John Gilmore's PD-Tar program with the 1.2
Minix C compiler.  The compiler "blows up" on what seems to be legal
C.  It dies with the diagnostic "Error: bombed out of codegen."  I've
tracked down the problem to the following function:

int
read_header()
{
	register int	i;
	register long	sum, recsum;
	register char	*p;
	register union record *header;

	header = findrec();
	head = header;		/* This is our current header */
	if (NULL == header) return EOF;

	recsum = from_oct(8,  header->header.chksum);

	sum = 0;
	p = header->charptr;
	for (i = sizeof(*header); --i >= 0;) {
		/*
		 * We can't use unsigned char here because of old compilers,
		 * e.g. V7.
		 */
		sum += 0xFF & *p++;
	}

/* ... more stuff, deleted for brevity's sake */

If I remove the register declarations and change the line

		sum += 0xFF & *p++;

to
		sum += 0xFF & *p;
		++p;

the compilation seems to work.

I don't think the compiler is running out of memory, since I moved
both compiler and pdtar to a Sun and got the same results.

Any ideas why this happens?

Once I get everything comiled, I run into a problem linking.  Asld
insists that the lable _12 is multiply defined.  Looking over the .s
files, it is true, there are several _12s scattered in various files.
What causes this?

I may break down and massage the assembly language by hand just to
compile this program, but I'd just like to know why the 1.2 compiler
(in most respects, a vast improvement over the 1.1 version) hates
*this* program so.  I haven't had trouble with Minix sources or other
public domain Un*x programs.

					Frank Wortner
					frank@morgan.com
					...!{uunet, sun}!mstan!frank