[net.micro.att] AT&T PC7300 Compiler - 32k bug

bc10@rexago1.UUCP (Andrew C. Eisenberg) (01/06/86)

Recently when transferring a C program from a 3B2 to a PC7300, I ran into this
bug:  When a function in a program has a data space exeeding 32K bytes (words?)
of memory, the assembler code produced by the compiler produces an illegal 
relative branch that would require more than 16bits to execute on a function
call.  This was found out in a call to the AT&T hotline.  Our PC7300 is using
UNIX 3.04 with UNIX 2 development tools.  However, the same error also occurred
on another PC7300 with UNIX 2.0.0.4 and the same development tools.  According
to the hotline, a similar problem has occurred with FORTRAN which we do not use
here.  

Solutions: 
1) Split up the offending function into smaller functions and recompile (with
separate modules?) 
2) Make some of the data global, but this allegedly has a similar 32k limit.
3) If you need more than 32k use malloc.
4) Make your data structure smaller!

In my case, 4 was the solution since I had overgenerously allocated data
space.

If you haven't heard this before, then you have been WARNED!
If you have experienced this problem before and have responses or 
clarifications, then please post to the net.

--------------------------------------------------------------------------------
		________________ ________________
	    /___|	       | |		|
	   / []||   ROADWAY    | |    ROADWAY	|
	  |____||______________|-|______________|
	   O-----O	      O	  O	       O

Andrew C. Eisenberg --  rexago1!bc10@Case.CSNET - for you internet folks
			...!decvax!cwruecmp!rexago1!bc10 - for UUCP
"Beam me up Scotty, there is no intelligent life here!"