tinycc-devel
[Top][All Lists]
Advanced

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

[Tinycc-devel] [patch] support for empty input register section in __asm


From: Filip Navara
Subject: [Tinycc-devel] [patch] support for empty input register section in __asm__ blocks
Date: Tue, 05 Jul 2005 02:09:51 +0200
User-agent: Mozilla Thunderbird 0.9 (Windows/20041103)

In GCC it's valid to write ...
   __asm__ ("mov %%fs:0x18, %0" : "=r" (ret) : );
...while TCC didn't accept it because of the empty input registers.

--- tccasm.c    Sat Jun 18 00:09:15 2005
+++ tccasm.c    Sun Jul  3 17:18:46 2005
@@ -916,21 +916,23 @@
         nb_outputs = nb_operands;
         if (tok == ':') {
             next();
-            /* input args */
-            parse_asm_operands(operands, &nb_operands, 0);
-            if (tok == ':') {
-                /* clobber list */
-                /* XXX: handle registers */
-                next();
-                for(;;) {
-                    if (tok != TOK_STR)
-                        expect("string constant");
-                    asm_clobber(clobber_regs, tokc.cstr->data);
+            if (tok != ')') {
+                /* input args */
+                parse_asm_operands(operands, &nb_operands, 0);
+                if (tok == ':') {
+                    /* clobber list */
+                    /* XXX: handle registers */
                     next();
-                    if (tok == ',') {
+                    for(;;) {
+                        if (tok != TOK_STR)
+                            expect("string constant");
+                        asm_clobber(clobber_regs, tokc.cstr->data);
                         next();
-                    } else {
-                        break;
+                        if (tok == ',') {
+                            next();
+                        } else {
+                            break;
+                        }
                     }
                 }
             }

reply via email to

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