https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65401
--- Comment #3 from Jakub Jelinek <jakub at gcc dot gnu.org> --- In the 9345 else if (GET_CODE (rhs) == AND 9346 && paradoxical_subreg_p (XEXP (rhs, 0)) 9347 && GET_CODE (SUBREG_REG (XEXP (rhs, 0))) == MEM 9348 && CONST_INT_P (XEXP (rhs, 1)) 9349 && rtx_equal_for_field_assignment_p (gen_rtx_MEM (GET_MODE (dest), 9350 XEXP (SUBREG_REG (XEXP (rhs, 0)), 0)), 9351 dest)) hunks (two similar ones) sometimes GET_MODE (SUBREG_REG (XEXP (rhs, 0))) is == GET_MODE (dest), then it is certainly safe for big endian and you shouldn't need to even create a new MEM. For the other case, I'd say when increasing the mode size you really need to adjust the address of the mem for endianity, dunno if it is possible to have also narrower dest than the SUBREG_REG MEM, in that case punt? Oh, and please use MEM_P instead of GET_CODE () == MEM.