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: "John Yates" <jyates at netezza dot com>
- Cc: "Yaro Pollak" <yarop at altair-semi dot com>, gcc-help at gcc dot gnu dot org
- Date: Sun, 05 Feb 2006 16:02:11 -0500
- Subject: Re: Unaligned access to packed structs on ppc405
- References: <4D87F853B8020F4888896B1507DC0F09026798@mail2.netezza.com>
>>>>> John Yates writes:
John> Do I read this correctly? Are you truly saying that two structs
John> with identical layout will trigger different code sequences just
John> because one was declared packed?
Yes. Why is that strange? attribute packed assigns the smallest
possible alignment so that the compiler composes the layout of the
structure or bitfield in the more compact form possible. Even if the
layout produced is the same, the smaller alignment is carried around with
the fields and causes the compiler to use more conservative access
operations.
David