[cfe-commits] r102045 - in /cfe/trunk: lib/CodeGen/CGRecordLayoutBuilder.cpp test/CodeGen/bitfield-2.c

Jakob Stoklund Olesen stoklund at 2pi.dk
Wed Apr 21 23:26:44 PDT 2010


On Apr 21, 2010, at 7:35 PM, Daniel Dunbar wrote:

> Author: ddunbar
> Date: Wed Apr 21 21:35:46 2010
> New Revision: 102045
> 
> URL: http://llvm.org/viewvc/llvm-project?rev=102045&view=rev
> Log:
> IRgen: Rewrite bit-field access policy to not access data beyond the bounds of the structure, which we also now verify as part of the post-layout consistency checks.
> - This fixes some pedantic bugs with packed structures, as well as major problems with -fno-bitfield-type-align.
> 
> - Fixes PR5591, PR5567, and all known -fno-bitfield-type-align issues.
> 
> - Review appreciated.

> +  uint64_t AccessStart = FieldOffset - (FieldOffset % TypeSizeInBits);

Perhaps this should only align to MinAlign(ContainingTypeAlign, ABIAlign(Type)). It could save you a load if it is going to be less aligned anyway.

Otherwise, llvm-gcc is jealous!

/jakob





More information about the cfe-commits mailing list