https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70965
--- Comment #8 from Jakub Jelinek <jakub at gcc dot gnu.org> --- Created attachment 40053 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=40053&action=edit gcc7-pr70965.patch This untested patch fixes the ICE, but the question is if it is the right spot to do that, or if gsi_remove (, true) shall do that, or just cleanup cfg shall rebuild cgraph edges (under what conditions?) if it has done any changes, ...