This is the mail archive of the crossgcc@sourceware.cygnus.com mailing list for the crossgcc project.

See the CrossGCC FAQ for lots more infromation.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

RE: 8K limit on arrays.


Thanks for responses Alan,

see my comments below

At 10:35 AM +1100 11/9/99, David Williams wrote:
>Hi all,
>
>A while ago I posted a query about 8K limit on arrays in GCC. Anyway it
>turns out the problem is related to -mshort option. When not using this
>option (which makes integers 16 bit by default) the problem disappers.


	With 16 bit arithmetic, the biggest calculated displacement on
	an array is 16 bits (that's -32k..32k).  Divide that by
	4 gives an 8k limit on long and float arrays.  doubles would
	be even smaller.

More specifically the problem with that the array (no matter what type) 
could not exceed 8K bytes. That is an array of 16 bit ints could not be 
bigger than 4095! I discovered the problem with an array of structures (10 
bytes per structure) that could not exceed 818 elements!

>I also noticed that the code size generated goes down, not up as I
>expected. Can anyone explain this.


	The 68k has variable-length addressing modes.  Without -mshort,
	it can have 32bit displacements added to an object.  That makes
	the instructions significantly longer.

	Depending on the code you are compiling, these longer instructions
	may not be more efficient.


I should have been more specific here, the total code size when using 
-mshort is actually larger, than when not using
 -mshort. This seems to be the opposite of what I would expect.

Dave.


------
Want more information?  See the CrossGCC FAQ, http://www.objsw.com/CrossGCC/
Want to unsubscribe? Send a note to crossgcc-unsubscribe@sourceware.cygnus.com


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]