On 3/10/23 09:28, Herman ten Brugge wrote:
The attached program is a reduced version of yarpgen v1 code.
The code works with gcc.
The code has a floating point exception with tcc.
Maybe another nocode_wanted problem?
I tried the attached patch and now yarpgen runs without problems for 30
minutes.
I am not familiair with the code. I just noticed that nocode_wanted was
different on
entry and exit.
Herman
diff --git a/tccgen.c b/tccgen.c
index 7368030..b039b2d 100644
--- a/tccgen.c
+++ b/tccgen.c
@@ -6263,7 +6263,7 @@ static int condition_3way(void)
static void expr_landor(int op)
{
- int t = 0, cc = 1, f = 0, i = op == TOK_LAND, c;
+ int t = 0, cc = 1, f = 0, i = op == TOK_LAND, c, prev_ncw = nocode_wanted;
for(;;) {
c = f ? i : condition_3way();
if (c < 0)
@@ -6286,6 +6286,7 @@ static void expr_landor(int op)
nocode_wanted -= f;
} else {
gvtst_set(i, t);
+ nocode_wanted = prev_ncw;
}
}
_______________________________________________
Tinycc-devel mailing list
[email protected]
https://lists.nongnu.org/mailman/listinfo/tinycc-devel