Hi Adhermerval, The argument code looks good now, but this isn't right:
+ int ninsn = aarch64_internal_mov_immediate (reg10, GEN_INT (-allocate), + true, Pmode); + gcc_assert (ninsn == 1 || ninsn == 2); + if (ninsn == 1) + { + if (allocate > 0) + emit_insn (gen_insv_immdi (reg10, GEN_INT (0), GEN_INT (0xffff0000))); + else + emit_insn (gen_insv_immdi (reg10, GEN_INT (0), GEN_INT (0x0))); + } Both insv_imm will always set the low 16 bits of X10 to zero, corrupting the value of the first instruction. It seems best to emit both instructions explicitly and use positive values to avoid the zero special case (this should make the linker code updating the allocation simpler too): gen_rtx_SET (reg10, GEN_INT (allocate & 0xffff)) gen_insv_immdi (reg10, GEN_INT (16), GEN_INT ((allocate & 0xffff0000) >> 16)) I bet this will avoid the crash you mentioned. Wilco