http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55093
--- Comment #5 from H.J. Lu <hjl.tools at gmail dot com> 2012-10-29 00:41:19 UTC --- This patch: diff --git a/gcc/lra-eliminations.c b/gcc/lra-eliminations.c index 2222d80..681c609 100644 --- a/gcc/lra-eliminations.c +++ b/gcc/lra-eliminations.c @@ -272,7 +272,7 @@ get_elimination (rtx reg) if ((hard_regno = REGNO (reg)) < 0 || hard_regno >= FIRST_PSEUDO_REGISTER) return NULL; if ((ep = elimination_map[hard_regno]) != NULL) - return ep->from_rtx != reg ? NULL : ep; + return ep->from_rtx != reg && ep->from != hard_regno ? NULL : ep; if ((offset = self_elim_offsets[hard_regno]) == 0) return NULL; /* This is an iteration to restore offsets just after HARD_REGNO fixes the IC.