Dynamic dead-code detection