tinycc-devel
[Top][All Lists]
Advanced

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

[Tinycc-devel] tcc segfaults with complex struct initialization


From: Assaf Gordon
Subject: [Tinycc-devel] tcc segfaults with complex struct initialization
Date: Wed, 16 Mar 2016 15:57:00 -0400
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.5.1

Hello,

I'm happy to see that some recent commit fixed the '#include_next' problems 
(mentioned here: 
http://lists.nongnu.org/archive/html/tinycc-devel/2015-12/msg00018.html ), and 
latest TCC (rev  aa1ed61) can almost compile GNU coreutils (at least - 
continues beyond the above mentioned '#include_next' issue).

But,
it now segfaults like so:

    $ git clone git://git.sv.gnu.org/coreutils.git && cd coreutils
    $ ./bootstrap
    $ ./configure --without-selinux CC=tcc
    $ make V=1
    ...
    make[2]: Entering directory `/tmp/foo/coreutils'
    source='src/timeout.c' object='src/timeout.o' libtool=no \
        DEPDIR=.deps depmode=tcc /bin/bash ./build-aux/depcomp \
        tcc  -I. -I./lib  -Ilib -I./lib -Isrc -I./src    -g -c -o src/timeout.o 
src/timeout.c
    tcc: x86_64-gen.c:421: load: Assertion `((ft & 0x000f) == 0) || ((ft & 0x000f) == 12) 
|| ((ft & 0x000f) == 4) || ((ft & 0x000f) == 5) || ((ft & 0x000f) == 6)' failed.
    ./build-aux/depcomp: line 173:  6389 Aborted                 (core dumped) "$@" -MD 
-MF "$tmpdepfile"
    make[2]: *** [src/timeout.o] Error 134

The offending code is a complex struct initialization, perhaps related to 
recent discussion:
  http://lists.nongnu.org/archive/html/tinycc-devel/2016-03/msg00042.html

from src/timeout.c:137 ( 
http://git.savannah.gnu.org/cgit/coreutils.git/tree/src/timeout.c#n135 ):
===
  struct timespec ts = dtotimespec (duration);
  struct itimerspec its = { {0, 0}, ts };
===

When changing the initialization to:
    struct itimerspec its = { {0, 0} };
The compilation succeeds (though of course the struct is not initialized 
properly)

regards,
 - assaf




reply via email to

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