https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97576
--- Comment #2 from Jan Hubicka <hubicka at gcc dot gnu.org> --- The problem here is that clone materialization invalidates statement pointers in refs. We clean these at the begining of late optimization, I guess it should be done on demand during materialization (they are not used past that point, but we do not have convenient place to clear them).