Note the "unbound variable: var2". This doesn't seem to cause any errors down the line because the third operand to + is just ignored in later passes, but it suggests there may be a bug in the ANF pass. If you add the following assertion:
assert(expr[4] == nil)
right after line 257 in pf.backend, it will trigger some failures because of the extra operand. Here's the full SSA output from running pflua-compile "ip[2:1] + ip[2:1] == 1":
If you turn
PF_VERBOSE
on for certain expressions with a duplicated arithmetic expression, you can get some invalid blocks like the following:Note the
"unbound variable: var2"
. This doesn't seem to cause any errors down the line because the third operand to+
is just ignored in later passes, but it suggests there may be a bug in the ANF pass. If you add the following assertion:right after line 257 in
pf.backend
, it will trigger some failures because of the extra operand. Here's the full SSA output from runningpflua-compile "ip[2:1] + ip[2:1] == 1"
: