SI-8315 Fix crash in dead code elimination

This bug is blocking the under-consideration #3498.