https://gcc.gnu.org/bugzilla/show_bug.cgi?id=112616
--- Comment #6 from Martin Jambor <jamborm at gcc dot gnu.org> --- (In reply to Andrew Pinski from comment #1) > # q_11 = PHI <0B(2), removed_return.14_14(D)(4), > removed_return.14_14(D)(3)> > _12 = *q_11; > > > WTF???? Well, _12 is not used anywhere, so the code expects the entire load to be DCEd. But it gets optimized to _2 = MEM[(int *)0B]; before DCE sees it and then even if _2 is never used anywhere, apparently the statement is kept there as an intended trap (I guess). I have adjusted my patch to make DCE for removed returnd part of IPA edge redirection so that it does not have compare-debug problems and submitted it for review in: https://inbox.sourceware.org/gcc-patches/ri6cyu1e9kw.fsf@/T/#u