Remove dead assignments that the compiler optimizes out.