Closed maximumspatium closed 6 years ago
Need a PR with a (currently broken) testcase ;-).
Need a PR with a (currently broken) testcase ;-).
Sure, PR sent.
Ok, by resolving that would require to get rid of the typecasts on l-values. For example, (u32) would be just dropped. (i32) would be dropped to (re: https://github.com/pfalcon/ScratchABlock/issues/8). The rest will be converted to mask/or.
Ok, by resolving that would require to get rid of the typecasts on l-values.
Yes, those should be further completely removed by type analysis.
Ok, a pass to rewrite destinations is implemented in https://github.com/pfalcon/ScratchABlock/commit/f3756c3637a68a6f44a19f2405a2b6bb8b29f315.
Fixed, tests added.
I noticed that expression propagation doesn't work correctly in the case the instruction destination contains a type cast. Consider the following test case:
Expected C-output:
SABl produces the following C-output instead:
That's why the type cast of the instruction destination in the line 12 isn't removed before updating the state in
xform/bblock_propagation()
. This leads to the following two state entries after processing the instruction nr. 12:Subsequent propagation will therefore pick up
$a2
and not(u32)$a2
.