This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Unaligned access to packed structs on ppc405


>>>>> 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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]