[fpc-devel] Bitpacked Record Bug

Jonas Maebe jonas.maebe at elis.ugent.be
Sun Oct 24 21:49:38 CEST 2010


On 23 Oct 2010, at 15:47, Willibald Krenn wrote:

> in nutils.pas (~ 1155)
> subscriptn:
> result:= is_packed_record_or_object(tsubscriptnode(n).left.resultdef)
>          and (
>          (tsubscriptnode(n).vs.vardef.packedbitsize mod 8 <> 0) or
>          (tsubscriptnode(n).vs.fieldoffset mod 8 <>0));
> 
> Now, my question is why is an access with a size mod 8 and an offset mod 8 considered NOT bitpacked?

It should probably check whether the packedbitsize is in [8, 16, 32, 64]. The reason is that if you have a load from a byte-aligned address using a size that is natively supported by the code generator, you don't have to go through all the special-purpose code for bitpacked accesses. 24 bits is however not a size that is natively supported by the code generator, so it has to be treated as a bitpacked access.


Jonas


More information about the fpc-devel mailing list