I should also add that there is a rare situation that the side effect analysis could be wrong: while generating a function 'f', if the generator creates a function call that might write 'g_618', and later the generator back tracks and removes the call, the side effect of the invocation might be still included in the overall effect of the function 'f'.
In your test case, if 'g_618' is only read/written by a dead function, the wrong analysis is most likely caused by a removed call to that function.
-Xuejun