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 <g.mascell...@gmail.com>
Postdoc researcher - Université Libre de Bruxelles

Attachment: signature.asc
Description: OpenPGP digital signature

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

Reply via email to