reko icon indicating copy to clipboard operation
reko copied to clipboard

Dead code elimination removes stack allocated structures incorrectly

Open uxmal opened this issue 10 years ago • 1 comments

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.

uxmal avatar Aug 01 '15 07:08 uxmal

This is proving to be a major work item. Following this on the analysis-development branch

uxmal avatar Feb 22 '16 18:02 uxmal