tinycc-devel
[Top][All Lists]
Advanced

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

Re: [Tinycc-devel] TinyCC failure on i386


From: Czcibor Bohusz-Dobosz
Subject: Re: [Tinycc-devel] TinyCC failure on i386
Date: Fri, 13 Dec 2019 15:34:33 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.3.0

The same seems to happen on Arch Linux:

$ gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-pc-linux-gnu/9.2.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: /build/gcc/src/gcc/configure --prefix=/usr --libdir=/usr/lib --libexecdir=/usr/lib --mandir=/usr/share/man --infodir=/usr/share/info --with-bugurl=https://bugs.archlinux.org/ --enable-languages=c,c++,ada,fortran,go,lto,objc,obj-c++,d --enable-shared --enable-threads=posix --with-system-zlib --with-isl --enable-__cxa_atexit --disable-libunwind-exceptions --enable-clocale=gnu --disable-libstdcxx-pch --disable-libssp --enable-gnu-unique-object --enable-linker-build-id --enable-lto --enable-plugin --enable-install-libiberty --with-linker-hash-style=gnu --enable-gnu-indirect-function --enable-multilib --disable-werror --enable-checking=release --enable-default-pie --enable-default-ssp --enable-cet=auto gdc_include_dir=/usr/include/dlang/gdc
Thread model: posix
gcc version 9.2.0 (GCC)

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

- Czcibor

W dniu 13.12.2019 o 15:19, Giovanni Mascellani pisze:
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.

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

reply via email to

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