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


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

Reply via email to