https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64170
Jakub Jelinek <jakub at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |ASSIGNED Assignee|unassigned at gcc dot gnu.org |jakub at gcc dot gnu.org --- Comment #2 from Jakub Jelinek <jakub at gcc dot gnu.org> --- Created attachment 34182 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=34182&action=edit gcc5-pr64170.patch Untested fix. The bug was that maybe_get_dominating_check wasn't called on *base_checks if it returned non-NULL on *ptr_checks. But that function has two purposes, one is to clean up the vector, so that it doesn't contain any stale stmts (and this is what can_remove_asan_check relies on), the other is to return the last element in the vector if there are still any.