https://gcc.gnu.org/bugzilla/show_bug.cgi?id=117919
--- Comment #3 from Filip Kastl <pheeck at gcc dot gnu.org> --- I found that arguments of the PHI get removed because its whole basic block gets removed. Actually, basic blocks 10-13 get removed. This happens in a call to 'replace_uses_by' function. I think that EH edges are involved in this somehow. I'll try to get even a better idea about what is happening and figure out how to fix this. Maybe it would be correct to just skip PHIs that were removed from the IR during the pass.