https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87901
--- Comment #4 from Andrew Pinski <pinskia at gcc dot gnu.org> --- The problem is simple. ``` /* We want &lhs for the MEM_REF expression. */ tree lhs_addr = build_fold_addr_expr (gimple_assign_lhs (stmt)); if (! is_gimple_min_invariant (lhs_addr)) return; ``` We just need a STRIP_USELESS_TYPE_CONVERSION there; At least is what is needed for the testcase in comment #3 which I think is enough for PR 36602 really. We get this now: ``` MEM <char[8]> [(char * {ref-all})&z] = {}; MEM <unsigned char[24]> [(char * {ref-all})&z + 8B] = {}; ``` For the testcase in comment 2, it is harder and not currently handled and I am not sure it should be here; store merging handles it otherwise. Note for s/17/16/ we still fail; I will handle that afterwards.