tinycc-devel
[Top][All Lists]
Advanced

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

Re: [Tinycc-devel] State of the tcc project


From: jiang
Subject: Re: [Tinycc-devel] State of the tcc project
Date: Thu, 19 Jun 2014 12:37:28 +0800
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.5.0

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

address@hidden:~/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

reply via email to

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