This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: Unaligned access to packed structs on ppc405
- From: David Edelsohn <dje at watson dot ibm dot com>
- To: Yaro Pollak <yarop at altair-semi dot com>
- Cc: gcc-help at gcc dot gnu dot org
- Date: Sun, 29 Jan 2006 12:16:24 -0500
- Subject: Re: Unaligned access to packed structs on ppc405
>>>>> Yaro Pollak writes:
> I am cross-compiling on GCC 3.4.1 for the PowerPC 405, which can handle
> unaligned accesses in hardware.
> Whenever I am accessing members of a packed bit-struct by pointer, the
> compiler produces byte accesses, instead of 4-byte acceses.
> I've tried to use |-mstrict-align but to no avail.
What does "|-mstrict-align" mean? -mstrict-align means "do not
assume that unaligned accesses are handled by the system." You are
requesting that the compiler assume the target requires strict alignment
and then questioning why it is accessing a packed bit-struct assuming the
least alignment.
David