*more* alignment problems

David Edelsohn dje@watson.ibm.com
Thu Mar 30 13:21:00 GMT 2000


>>>>> Richard Kenner writes:

> Because all of those bitfield functions were manipulating alignment in
> bytes, the SLOW_UNALIGNED_ACCESS macro expects the alignment to be
> bytes.  The primary question for SLOW_UNALIGNED_ACCESS is whether the
> alignment is less than the natural alignment for the type, usually in
> granularity of bytes, not bits.

Richard> Why does it matter which way it's defined?  I changed the macro in
Richard> rs6000.h to accept bits.

	It does not matter how it is defined and changing all uses is
fine.  expmed.c:store_bit_field() uses the macro, so if there is some
confusion over the units of alignment in the function, it will affect the
call to the macro.

	Actually, the use of SLOW_UNALIGNED_ACCESS() which I implemented
is incomplete because it often uses the alignment of the containing object
and not the effective alignment of the bitfield based on the actual offset
used. 

David


More information about the Gcc mailing list