mirror of
git://repo.or.cz/tinycc.git
synced 2026-06-25 22:34:19 +08:00
bitfields: fix long bitfields
now the testcase works on i386-linux as well.
This commit is contained in:
parent
1094891e67
commit
377e8e5e68
6
tccgen.c
6
tccgen.c
@ -3362,9 +3362,9 @@ static void struct_layout(CType *type, AttributeDef *ad)
|
|||||||
(ofs2 / (typealign * 8)) > (size/typealign))) {
|
(ofs2 / (typealign * 8)) > (size/typealign))) {
|
||||||
c = (c + ((bit_pos + 7) >> 3) + typealign - 1) & -typealign;
|
c = (c + ((bit_pos + 7) >> 3) + typealign - 1) & -typealign;
|
||||||
bit_pos = 0;
|
bit_pos = 0;
|
||||||
} else while (bit_pos + bit_size > size * 8) {
|
} else if (bit_pos + bit_size > size * 8) {
|
||||||
c += size;
|
c += bit_pos >> 3;
|
||||||
bit_pos -= size * 8;
|
bit_pos &= 7;
|
||||||
}
|
}
|
||||||
offset = c;
|
offset = c;
|
||||||
/* In PCC layout named bit-fields influence the alignment
|
/* In PCC layout named bit-fields influence the alignment
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user