[comp.sys.nsc.32k] GCC problems

cruff@ncar.ucar.edu (Craig Ruff) (10/31/90)

I've run across a pair of problems with GCC (wbc version, cross
compiling on a sparc) while trying to compile the stand alone IO
library.  Basically it boils down to GCC using integer constants that
exceed the range of the largest displacement available as an addressing
mode.  For example, the following lines both cause the problem:

1)	register char	*p = (char *) (0x28000000 + 0x10 * n);

2)	*(char *) 0x30000000 = 0;

What happens is that the compiler causes the following assembly code to
be generated:

1)	movd 8(fp),r1
	ashd 4,r1
	addr 671088640(r1),r0

2)	movqb 0,@805306371

I know I can track down the problem in the machine description file
and attempt to fix it, but has anyone else already done so?

By the way, rewriting the first C line to:

	register char	*p = (char *) (0x10 * n + 0x28000000);

gets around the problem.  Rewriting the second line to use a pointer
would solve that one also.
-- 
Craig Ruff      	NCAR			cruff@ncar.ucar.edu
(303) 497-1211  	P.O. Box 3000
			Boulder, CO  80307