The following patch fixes http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58335
It required to implement a new approach for elimination updates for insn frame_pointer = hard_frame_pointer + offset. The previous implementation used parsing insns generated for offset elimination for given insn. It is hard to parse all possible variants for such elimination on different targets. For example, s390 code is quite different from x86/x86-64 code and that was the reason for the PR. The new implementation uses temporarily REG_EQUAL notes to avoid generated insns parsing. It solves the problem and makes LRA more portable. The patch was successfully bootstrapped and tested on x86/x86-64 and s390. Committed as rev. 202536. 2013-09-12 Vladimir Makarov <vmaka...@redhat.com> PR middle-end/58335 * lra-eliminations.c (remove_reg_equal_offset_note): New. (eliminate_regs_in_insn): Rewrite frame pointer to hard frame pointer elimination with using remove_reg_equal_offset_note.