[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Tinycc-devel] Largish mob update from me
From: |
grischka |
Subject: |
Re: [Tinycc-devel] Largish mob update from me |
Date: |
Sun, 18 Dec 2016 19:31:27 +0100 |
User-agent: |
Thunderbird 2.0.0.23 (Windows/20090812) |
Michael Matz wrote:
ST_FUNC void g(int c)
{
int ind1;
if (nocode_wanted)
tcc_error("internal: code generated but nocode_wanted");
ind1 = ind + 1;
True. The use of nocode_wanted (and even more so my extension to
suppress code generation for optimization) is somewhat fragile until the
above works. But OTOH this "misuse" mostly works right now :)
Generating jumpy code (i.e. in conditionals and for top-level
statements) as well as gv/gvtst is most susceptible currently to trigger
an assert like the above as reflected in one of my added comments:
Ok, I guess the best we can do to make sure the assert of above
will never trigger is to tell the compiler to optimize it out,
like so:
ST_FUNC void g(int c)
{
int ind1;
if (nocode_wanted)
return;
if (nocode_wanted)
tcc_error("internal: code generated but nocode_wanted");
Why I think this is necessary is because I got some regression wrt.
your improved "expr_land/lor()", and I wondered whether maybe the
code was wrong in itself or in its trust on the underlying nocode
machinery. So to find out I needed a machinery that works ;)
Details here:
http://repo.or.cz/tinycc.git/commitdiff/f843cadb6bc07b3b3de6786233df4592d2d5f60d
There aren't any if's with (nocode_wanted) in tccgen.c anywhere
anymore, exept the 3 mentioned in the patch, and it I'll be happy
if that can stay so.
Cheers,
--- grischka
Re: [Tinycc-devel] Largish mob update from me, Thomas Preud'homme, 2016/12/17
Re: [Tinycc-devel] Largish mob update from me, Steffen Nurpmeso, 2016/12/21