[fpc-devel] data alignment and int64 (or qword,	maybe any singlepiece of size 8 if any)
    Peter Vreman 
    peter at freepascal.org
       
    Tue May 16 08:18:19 CEST 2006
    
    
  
>
>
> Op Mon, 15 May 2006, schreef ???? ???????????:
>
>> > Suppose you have an array of b. Then, with a size of 12, there would
>> be no
>> > guarantee that an access to b.ab is aligned. So, the compiler pads the
>> > record to a multiple of the largest field.
>> >
>> > Dani?l
>>
>> I didn't state that it's useless. It's just unexpected as it is.
>>
>> The result is the same both with -O3r and -Og switches.
>> Setting processor to 386 (I don't think that such an alignment helps its
>> performance) doesn't change the result.
>
> This is true, an 32-bit processor has no advantage of 64-bit alignment of
> 64-bit value, so it is open to discussion wether the compiler should
> really do this for 64-bit values.
This is not always true. Sparc requires 64bit alignment for doubles. And
i386 requires 128bit alignment for XMM.
    
    
More information about the fpc-devel
mailing list