Re: Unaligned access to packed structs on ppc405

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



>>>>> Yaro Pollak writes:

> If on the other hand I compile:
> 
>    Test pt;
>    return pt.b + pt.c + pt.d;
> 
>    lwz 3,8(1)

	That is an artifact of the example.  If I declare "pt" as a global
variable, GCC 4.1 prerelease produces three lbz.

	The lbz has to do with the size and the packed alignment.  With
the packed structure, GCC chooses the smallest memory access that covers
the bitfield.  Once GCC has chosen bytes, it cannot merge the loads
together.  If the structure were not declared packed, GCC would use wider
loads with masking, and then determine that the loads refer to the same
object. 

David


[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux