Hi,

On Wed, 3 May 2017, grischka wrote:

> However, suppose we have a field with bit_pos=5,bit_size=32.
> In order to read it we need to read 40 bits, yes?  How do we
> do that on a 32-bit target, for example?

Yep, we don't (i.e. we're buggy in these cases and always were).  It's one 
example of the class of problems I'd added a comment on (tcctest.c ca. 
line 2070):

#ifndef __i386__
    /* on i386 we don't correctly support long long bit-fields.
       The bitfields can straddle long long boundaries (at least with
       GCC bitfield layout) and code generation isn't prepared for this
       (would have to work with two words in that case).  */
...

;-)

This also extends to long bit-fields straddling more than four bytes on 
32bit (or eight bytes on 64 bit).  Luckily those seems to happen 
relatively seldom in practice.

> Test code attached, have fun ... (no hurry ;)

He, thanks.  Yeah, eventually.


Ciao,
Michael.

_______________________________________________
Tinycc-devel mailing list
[email protected]
https://lists.nongnu.org/mailman/listinfo/tinycc-devel

Reply via email to