gcc Sparc alignment problems

Mike Stump mrs@apple.com
Mon Apr 19 21:46:00 GMT 2004


On Monday, April 19, 2004, at 12:38  PM, Phil Prentice wrote:
>  Does anyone know of a gcc compiler flag or option that would enable 
> us to
> compile and successfully run 'C' code that will access mis-aligned 
> integers
> or dioubles which runs on a SPARC workstation running Solaris.

A trap handler that does the unaligned load might be best, gcc 
generally doesn't support doing this without typing information, and 
even when that is used, you cannot violate the type system and expect 
it to work.

This could be done be changing your port to generate the unaligned 
loads and store all the time instead of the aligned versions, but, this 
would cause generated code to suffer significant performance 
degradation, which is why in general, people don't do this.



More information about the Gcc mailing list