https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69117
--- Comment #4 from Jan Hubicka <hubicka at gcc dot gnu.org> --- Hmm, OK, what seems to be done is the following. We end up calling vn_reference_lookup_3 on *e.3_12 = g.4_13; but we valueize the LHS as (gdb) p debug_generic_stmt (base1) MEM[(int * *)_10]; this seems fine. Eventually we call indirect_ref_may_alias_decl_p and that takes away the MEM_REF comparing *_10 with d and that returns false in: /* They also cannot alias if the pointer may not point to the decl. */ if (!ptr_deref_may_alias_decl_p (ptr1, base2)) return false; I think ptr_deref_may_alias_decl_p can not ignore type from MEM_REF.