[LLVMdev] structure packing and misaligned members

edA-qa mort-ora-y eda-qa at disemia.com
Sun May 12 08:13:06 PDT 2013


I'm trying to determine how to do my packed structure compilation and am
a bit unclear about how packed structures are handled. Consider this
structure:

%struct.packed = type <{ i8, i32 }>

Now if I get a pointer to the i32 element the pointer will not be
properly aligned for a typical i32. On my current machine (x86_64) the
cpu doesn't seem to care, but I suspect this isn't true on all platforms
(not is true on this platform if I do atomic operations). Yet the
pointer for this i32 which I get is the same as a normal i32 pointer.

Is there supposed to be a special marker for possibly misaligned
pointers? Or how I am supposed to track such misaligned pointers and
ensure they aren't used incorrectly?


-- 
edA-qa mort-ora-y
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
Sign: Please digitally sign your emails.
Encrypt: I'm also happy to receive encrypted mail.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 261 bytes
Desc: OpenPGP digital signature
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20130512/a6955951/attachment.sig>


More information about the llvm-dev mailing list