tinycc-devel
[Top][All Lists]
Advanced

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

Re: [Tinycc-devel] Buggy commit "Rework expr_landor"


From: Christian Jullien
Subject: Re: [Tinycc-devel] Buggy commit "Rework expr_landor"
Date: Thu, 23 Jan 2020 07:00:24 +0100

Hi Grischka,

I can't certify that your change fixes all parsing issues but, at least, it 
fixes my bignum library and all my huge non-reg tests suite pass again w.o. 
issue.

A very big thanks

C.

-----Original Message-----
From: Tinycc-devel [mailto:tinycc-devel-bounces+eligis=address@hidden] On 
Behalf Of grischka
Sent: Tuesday, January 21, 2020 00:45
To: address@hidden
Cc: address@hidden; Michael Matz
Subject: Re: [Tinycc-devel] Buggy commit "Rework expr_landor"

... Found something:

1) in vcheck_cmp():
     if (vtop->r == VT_CMP && !nocode_wanted --> && vtop->cmp_op > 1)
doesn't work, see the test I sent earlier.

2) in expr_landor():
     if (f) {
         vpop();
         vpushi(!i);
         nocode_wanted -= f;
     }
     gvtst_set(i, t);

This doesn't work as is with for example
     c = a && 0 ? 2 : 3;
because expr_cond() would turn off code at its first gvtst()
and never on again.

option 1:
     if (f || condition_3way() == !i) {
         vpop();
         vpushi(!i);
         gsym(t);
         nocode_wanted -= f;
     } else
         gvtst_set(i, t);

This appears to generate byte-identical code to before, with my tests.

option 2:
     moving up 'ncw_prev = nocode_wanted;'.
This appears to work too but generates more code.

It's all somehow brittle, with the mix of ++/-- with |=/&= nocode_wanted.

Sigh,

--- grischka


_______________________________________________
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]