https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98969
--- Comment #5 from Jakub Jelinek <jakub at gcc dot gnu.org> --- Yeah, seems the analyzer looked through the cast, so either it shouldn't, or it needs to readd the cast in there. As for print_mem_ref, if we wanted to protect it from bogus MEM_REF creation (not sure about if we want to), the right change IMHO would be to set access_type to NULL_TREE if TREE_TYPE (arg) doesn't have POINTER_TYPE_P, and in the spots that use access_type treat access_type NULL as unknown access type, e.g. access_cast should be true if access_type is NULL, and char_cast should be true too.