[LLVMdev] structure packing and misaligned members

edA-qa mort-ora-y eda-qa at disemia.com
Sun May 12 09:01:49 PDT 2013

On 12/05/13 17:50, Duncan Sands wrote:
> in LLVM, pointer types don't have an alignment associated with them.
> Instead it is pointer operations that have an alignment (when relevant),
> for example load and store instructions have an optional alignment.  So
> you need to put the alignment information onto the loads and stores that
> you generate in your front-end.

Okay, so I will track that on my own. Though I'm a bit confused then by
what clang is emitted for packed C structures. It appears an "int*" is
always loaded with "align 8" regardless of where it comes from. I know C
says you have to be responsible for your own alignment, so is this
result from clang correct?

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/7e7b7740/attachment.sig>

More information about the llvm-dev mailing list