https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61221
--- Comment #2 from Richard Biener <rguenth at gcc dot gnu.org> --- Interesting ;) We do some non-sensical simplification on dead code and ICE. But our dead-CFG compute code in SCCVN isn't up to recognizing a dead loop because it's conservative and not optimistic. Ultimatively this all is because of replacing a call with sth that doesn't have a VDEF and gsi_replace/update_stmt being called which releases an SSA name which corrupts the value-numbering lattice.