llvm-project
afe20e43 - [CodeGen] Fix TBAA verification failure when copying volatile C structs (#226615)

Commit
10 days ago
[CodeGen] Fix TBAA verification failure when copying volatile C structs (#226615) This fixes two bugs in GenBinaryFunc::visitVolatileTrivial (CGNonTrivialStruct.cpp): - It was passing the field's type instead of the containing struct's type to MakeAddrLValue. - It was calling EmitLoadOfLValue and EmitStoreThroughLValue even when the lvalue was an aggregate or a _Complex type. The functions end up calling EmitLoadOfScalar/EmitStoreOfScalar, which are meant to be used only for scalar values. Both caused CodeGen to emit incorrect TBAA metadata, which made the IR verifier fail. rdar://187077389
Author
Parents
Loading