diff mbox

[nios2,committed] fix structure sharing ICE

Message ID 584DF95B.7060107@codesourcery.com
State New
Headers show

Commit Message

Sandra Loosemore Dec. 12, 2016, 1:11 a.m. UTC
Since the last time I built GCC for nios2-linux-gnu target, it had 
started dying while building libgcc, with an ICE complaining about 
shared rtx structure in a CONST expression involving 
UNSPEC_PIC_CALL_SYM.  I tracked it down to failing to copy the source 
rtx for one of the pieces of a hi/lo register load pair.  Fixed thusly.

-Sandra
diff mbox

Patch

Index: gcc/config/nios2/nios2.c
===================================================================
--- gcc/config/nios2/nios2.c	(revision 243520)
+++ gcc/config/nios2/nios2.c	(working copy)
@@ -2334,7 +2334,8 @@  nios2_emit_move_sequence (rtx *operands,
 	    from = nios2_legitimize_constant_address (from);
 	  if (CONSTANT_P (from))
 	    {
-	      emit_insn (gen_rtx_SET (to, gen_rtx_HIGH (Pmode, from)));
+	      emit_insn (gen_rtx_SET (to,
+				      gen_rtx_HIGH (Pmode, copy_rtx (from))));
 	      emit_insn (gen_rtx_SET (to, gen_rtx_LO_SUM (Pmode, to, from)));
 	      set_unique_reg_note (get_last_insn (), REG_EQUAL,
 				   copy_rtx (operands[1]));