tinycc-devel
[Top][All Lists]
Advanced

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

[Tinycc-devel] nocode_wanted does not work


From: Edmund Grimley Evans
Subject: [Tinycc-devel] nocode_wanted does not work
Date: Sun, 3 Apr 2016 10:13:53 +0100
User-agent: Mutt/1.5.21 (2010-09-15)

> Hi! The following test hangs when compiled with tcc after 737f98421
>       tccgen.c: Bug fix for 992cbda and 3ff77a1: set nocode_wanted.
>       tests/tests2/78_vla_label.*: Add test

The change introduced at 737f98421 depends on "nocode_wanted" working.
But it doesn't work, of course. It's broken probably in lots of ways,
but in particular a "do" loop will generate code when it shouldn't. So
another instance of the same bug is demonstrated by this:

int main()
{
    return sizeof( ({ do { } while (1); }), 0 );
}

(So the bug perhaps only affects statement expressions, which are not
part of standard C.)

I wonder, how feasible is it to find every place in tccgen.c where a
back-end function like gjmp might be called and ensure that it won't
be called when nocode_wanted is set? Could this be done more
systematically at a lower level? Or at least fail with an explanatory
message if o() is called while nocode_wanted is set?

Edmund



reply via email to

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