tinycc-devel
[Top][All Lists]
Advanced

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

[Tinycc-devel] TinyCC failure on i386


From: Giovanni Mascellani
Subject: [Tinycc-devel] TinyCC failure on i386
Date: Fri, 13 Dec 2019 15:19:09 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.3.0

Hi,

TinyCC fails to test on i386 on the CI that I just set up. Apparently,
though, the problem is not in tcc, but in gcc, which is used to compile
the test program too and compare the results.

I managed to trim down the offending example to this:

int main() {
    asm volatile ("mov %%eax, %%eax\n" : : "i" ("A string"));
    return 0;
}

If I compile this with gcc (9.2) on Debian this happens:

$ gcc -g -m32 test.c
test.c: In function ‘main’:
test.c:3:5: warning: asm operand 0 probably doesn’t match constraints
    3 |     asm volatile ("mov %%eax, %%eax\n" : : "i" ("A string"));
      |     ^~~
test.c:3:5: error: impossible constraint in ‘asm’

I believe this is wrong, "i" should accept a literal string as value.
Also, the same program works on Compiler Explorer[1].

 [1] https://godbolt.org/z/xAP-dy

I suspect this might be a bug in Debian's gcc. Anybody not using Debian
could please try to compile this program and see what happens?

Thanks, Giovanni.
-- 
Giovanni Mascellani <address@hidden>
Postdoc researcher - Université Libre de Bruxelles

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

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