http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50063
--- Comment #16 from Jakub Jelinek <jakub at gcc dot gnu.org> 2011-12-20 00:22:19 UTC --- Well, you or whomever wants to fix this bug needs to propose some solution. I'm not familiar with avr, so I don't know if avr is doing something like this (starting function with r32 == r28) always, or always for functions that require frame pointer, conditionally only for some CPUs, ... If it is always that way, you might want to consider just in some backend initialization that is run after init_alias_target call change this_target_rtl->x_static_reg_base_value[STACK_POINTER_REGNUM] to this_target_rtl->x_static_reg_base_value[FRAME_POINTER_REGNUM] (or vice versa), so that the RTL alias analysis doesn't disambiguate r28 from r32 based MEM accesses. Or a target hook somewhere in init_alias_analysis, or #define FIND_BASE_TERM(X) avr_find_base_term (X) where that function would return under the conditions where body starts with r32 == r28 would if (REG_P (x) && REGNO (x) == STACK_POINTER_REGNUM) return find_base_term (frame_pointer_rtx); else return NULL_RTX;