https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104761
--- Comment #1 from Jakub Jelinek <jakub at gcc dot gnu.org> --- I think the problem is in: if (!bitmap_set_bit (visited, bb->index)) /* Avoid cycles. */ return true; pass_waccess::use_after_inval_p When walking the bbs from use_bb: <bb 6> : error.0_3 = error; // <--- use_stmt _4 = error.0_3->t; _5 = addrbin.s; _6 = qux (_5); corge (_6, _4); <bb 7> : goto <bb 7>; [INV] The 7->7 edge is just EDGE_FALLTHRU and we visit bb 7 and then return true even when there was an endless loop which means it can't reach inval_stmt.