tinycc-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Tinycc-devel] State of the tcc project (jiang)


From: jiang
Subject: [Tinycc-devel] State of the tcc project (jiang)
Date: Fri, 20 Jun 2014 13:58:36 +0800
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.5.0

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 {



reply via email to

[Prev in Thread] Current Thread [Next in Thread]