[LLVMdev] load widening conflicts with AddressSanitizer

Chris Lattner clattner at apple.com
Fri Dec 16 14:52:19 PST 2011


On Dec 16, 2011, at 2:45 PM, John Criswell wrote:
>> I believe it is 16-byte aligned based on ABI requirements for x86-64, though you're right that the optimizer will increase alignment in other cases.  In any case, we don't want to increase the size of the object, because that would prevent packing some other data in after it.  For example, a 2-byte aligned 10 byte object can be placed after it in memory if we keep it 22-bytes in size.
> 
> It seems that another option would be to check that both the alignment *and* size of the memory object permit safe load-widening and to not perform it on memory objects such as this 22-byte object.
> 
> Do you think such unsafe cases occur often in practice?

I'm not sure what "unsafe" means in this situation, it's clearly safe.  It also clearly happens in practice if it's causing you guys heartburn. :)

-Chris



More information about the llvm-dev mailing list