[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Tinycc-devel] if (0 == 1) { some_code(); }
From: |
Sergey Korshunoff |
Subject: |
Re: [Tinycc-devel] if (0 == 1) { some_code(); } |
Date: |
Sun, 24 Apr 2016 12:36:23 +0300 |
> A call to the printf is present
To skip a block I need to know if (COND) was const and false from the gvtst()
T_FUNC int gvtst(int inv, int t)
{
int v = vtop->r & VT_VALMASK;
if (v != VT_CMP && v != VT_JMP && v != VT_JMPI) {
vpushi(0);
gen_op(TOK_NE);
}
if ((vtop->r & (VT_VALMASK | VT_LVAL | VT_SYM)) == VT_CONST) {
/* constant jmp optimization */
if ((vtop->c.i != 0) != inv)
t = gjmp(t);
vtop--;
return t;
}
return gtst(inv, t);
}
But currently this is unpossible. Use a static variable? Or introduce
another gvtst with 3 parms?