PR 16899: Do not modify the basic block using the iterator, but keep the