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
2016-12-11 Sandra Loosemore <san...@codesourcery.com>
gcc/
* config/nios2/nios2.c (nios2_emit_move_sequence): Call copy_rtx
to avoid shared structure error.
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]));