[backport from gcc-4.8/trunk r190102 ] From: Richard Sandiford Subject: [committed] Fix rtx-sharing problem in split_insns Date: Thu, 02 Aug 2012 21:44:56 +0100 List-Archive: I hit a case where we were splitting a set of (const (unspec [...])) into something that still referred to the original expression. We reused that same expression as a REG_EQUAL note, leading to an rtx-sharing violation. Tested on mips64-linux-gnu and applied. Richard gcc/ 2012-08-02 Richard Sandiford * recog.c (split_insn): Copy the original SET_SRC before using it as a note. --- gcc-4.7.1/gcc/recog.c.~1~ 2012-05-04 13:13:20.000000000 +0200 +++ gcc-4.7.1/gcc/recog.c 2012-08-11 15:55:23.000000000 +0200 @@ -2823,7 +2823,8 @@ split_insn (rtx insn) if (note && CONSTANT_P (XEXP (note, 0))) set_unique_reg_note (last, REG_EQUAL, XEXP (note, 0)); else if (CONSTANT_P (SET_SRC (insn_set))) - set_unique_reg_note (last, REG_EQUAL, SET_SRC (insn_set)); + set_unique_reg_note (last, REG_EQUAL, + copy_rtx (SET_SRC (insn_set))); } }