This is my modified.
I tried to modify the Makefile, but my limited level, think of ways to modify later.

----------------------------------- tccgen.c -----------------------------------
index 7906ccf..4f2a02c 100644
@@ -2562,6 +2562,8 @@ ST_FUNC void vstore(void)
         /* leave source on stack */
     } else if (ft & VT_BITFIELD) {
         /* bitfield store handling */
+        SValue tmp;
+        tmp = vtop[0];
         bit_pos = (ft >> VT_STRUCT_SHIFT) & 0x3f;
         bit_size = (ft >> (VT_STRUCT_SHIFT + 6)) & 0x3f;
         /* remove bit field info to avoid loops */
@@ -2598,6 +2600,8 @@ ST_FUNC void vstore(void)
         gen_op('|');
         /* store result */
         vstore();
+        vtop--;
+        vpushv(&tmp);
     } else {
 #ifdef CONFIG_TCC_BCHECK
         /* bound check case */
index 22a8278..2fd4614 100644
@@ -1655,6 +1655,15 @@ void bitfield_test(void)
     else
         printf("st1.f2 != -1\n");

+    /* XXX: gcc bug
+    st1.f1 = st1.f2 = st1.f3 = st1.f4 = st1.f5 = 3;
+    printf("%d %d %d %d %d\n",
+           st1.f1, st1.f2, st1.f3, st1.f4, st1.f5);
+*/
+    st1.f2 = st1.f3 = st1.f4 = st1.f5 = 3;
+    printf("%d %d %d %d %d\n",
+           st1.f2, st1.f3, st1.f4, st1.f5);
+
     /* bit sizes below must be bigger than 32 since GCC doesn't allow
        long-long bitfields whose size is not bigger than int */
     struct sbf2 {

_______________________________________________
Tinycc-devel mailing list
Tinycc-devel@nongnu.org
https://lists.nongnu.org/mailman/listinfo/tinycc-devel

Reply via email to