Hi all,While looking in this area on other business I noticed we could be using the names R0_REGNUM and R1_REGNUM when creating those REG rtxs since it's a bit more descriptive that just 0 and 1.
Tested arm-none-eabi. Ok for trunk? Thanks, Kyrill 2014-12-11 Kyrylo Tkachov kyrylo.tkac...@arm.com * config/arm/arm.c (arm_load_tp): Use R0_REGNUM instead of constant 0 in gen_rtx_REG. (arm_tls_descseq_addr): Likewise. (arm_gen_movmemqi): Likewise. (arm_expand_epilogue_apcs_frame): Likewise. (arm_expand_epilogue): Likewise. (arm_expand_prologue): Likewise. Use R1_REGNUM instead of constant 1 in gen_rtx_REG.
diff --git a/gcc/config/arm/arm.c b/gcc/config/arm/arm.c index 64494e8..d17c81d 100644 --- a/gcc/config/arm/arm.c +++ b/gcc/config/arm/arm.c @@ -7431,7 +7431,7 @@ arm_load_tp (rtx target) emit_insn (gen_load_tp_soft ()); - tmp = gen_rtx_REG (SImode, 0); + tmp = gen_rtx_REG (SImode, R0_REGNUM); emit_move_insn (target, tmp); } return target; @@ -7495,13 +7495,13 @@ arm_tls_descseq_addr (rtx x, rtx reg) gen_rtx_CONST (VOIDmode, label), GEN_INT (!TARGET_ARM)), UNSPEC_TLS); - rtx reg0 = load_tls_operand (sum, gen_rtx_REG (SImode, 0)); + rtx reg0 = load_tls_operand (sum, gen_rtx_REG (SImode, R0_REGNUM)); emit_insn (gen_tlscall (x, labelno)); if (!reg) reg = gen_reg_rtx (SImode); else - gcc_assert (REGNO (reg) != 0); + gcc_assert (REGNO (reg) != R0_REGNUM); emit_move_insn (reg, reg0); @@ -14659,7 +14659,7 @@ arm_gen_movmemqi (rtx *operands) else { mem = adjust_automodify_address (dstbase, SImode, dst, dstoffset); - emit_move_insn (mem, gen_rtx_REG (SImode, 0)); + emit_move_insn (mem, gen_rtx_REG (SImode, R0_REGNUM)); if (last_bytes != 0) { emit_insn (gen_addsi3 (dst, dst, GEN_INT (4))); @@ -21092,8 +21092,8 @@ arm_expand_prologue (void) Just tell it we saved SP in r0. */ gcc_assert (TARGET_THUMB2 && !arm_arch_notm && args_to_push == 0); - r0 = gen_rtx_REG (SImode, 0); - r1 = gen_rtx_REG (SImode, 1); + r0 = gen_rtx_REG (SImode, R0_REGNUM); + r1 = gen_rtx_REG (SImode, R1_REGNUM); insn = emit_insn (gen_movsi (r0, stack_pointer_rtx)); RTX_FRAME_RELATED_P (insn) = 1; @@ -24866,7 +24866,7 @@ arm_expand_epilogue_apcs_frame (bool really_return) /* Restore the original stack pointer. Before prologue, the stack was realigned and the original stack pointer saved in r0. For details, see comment in arm_expand_prologue. */ - emit_insn (gen_movsi (stack_pointer_rtx, gen_rtx_REG (SImode, 0))); + emit_insn (gen_movsi (stack_pointer_rtx, gen_rtx_REG (SImode, R0_REGNUM))); emit_jump_insn (simple_return_rtx); } @@ -25148,7 +25148,7 @@ arm_expand_epilogue (bool really_return) /* Restore the original stack pointer. Before prologue, the stack was realigned and the original stack pointer saved in r0. For details, see comment in arm_expand_prologue. */ - emit_insn (gen_movsi (stack_pointer_rtx, gen_rtx_REG (SImode, 0))); + emit_insn (gen_movsi (stack_pointer_rtx, gen_rtx_REG (SImode, R0_REGNUM))); emit_jump_insn (simple_return_rtx); }