jiang int main()
http://repo.or.cz/w/tinycc.git/commitdiff/e5e7f488e22190f893152c0b2f73e9ba499c4169
- causes regression. Test case:
struct { unsigned a:9, b:7, c:5; } s;
s.a = s.b = s.c = 3;
printf("%d / %d / %d\n", s.a, s.b, s.c);
--> 219 / 91 / 3
index fcd1b8c..0451d9f 100644
--- a/tccgen.c
+++ b/tccgen.c
@@ -2690,6 +2690,8 @@ void vstore(void)
}
/* leave source on stack */
} else if (ft & VT_BITFIELD) {
+ SValue tmp;
+ tmp = vtop[-1];
/* bitfield store handling */
bit_pos = (ft >> VT_STRUCT_SHIFT) & 0x3f;
bit_size = (ft >> (VT_STRUCT_SHIFT + 6)) & 0x3f;
@@ -2727,6 +2729,7 @@ void vstore(void)
gen_op('|');
/* store result */
vstore();
+ vtop[0] = tmp;
} else {
#ifdef CONFIG_TCC_BCHECK
/* bound check case */
Thank you, tell me bug
This patch can solve the problem
jiang@jiang:~/test$ ./tcct -run c3.c
3 / 3 / 3
jiang restore 2dd8587c2f32d17a2cd0443a60a614a3fa9bbe29
http://repo.or.cz/w/tinycc.git/commitdiff/c6345b5a8af36d5577307860644010b1528257d3
- obviously mixed features without any description
- far from good implementations
To add compiler directives, did not write clearly
jiang
_______________________________________________
Tinycc-devel mailing list
[email protected]
https://lists.nongnu.org/mailman/listinfo/tinycc-devel