reko
reko copied to clipboard
Dead code elimination removes stack allocated structures incorrectly
The following code fragment
Foo_struct_t s;
s.x = 3;
bar (&stack_obj);
is decompiled to
fn0010000 (fp - 0x0000001C);
Dead code elimination removes the assignment because it can't prove that it is live. To fix this Reko must defer dead code elimination until type analysis determines what arguments the called function has and then that knowledge is propagated to the callee.
This is proving to be a major work item. Following this on the analysis-development branch