*参照元 [#x9826808] #backlinks *説明 [#c1f52dbd] -パス: [[gcc-8.3/gcc/reload1.c]] -FIXME: これは何? --説明 **引数 [#tbcf0d80] -なし **返り値 [#ga899a0f] -なし **参考 [#ce5ac8a1] *実装 [#o1b3e7d1] /* Initialize the table of registers to eliminate. Pre-condition: global flag frame_pointer_needed has been set before calling this function. */ static void init_elim_table (void) { struct elim_table *ep; const struct elim_table_1 *ep1; - --[[gcc-8.3/gcc/elim_table]] --[[gcc-8.3/gcc/elim_table_1]] if (!reg_eliminate) reg_eliminate = XCNEWVEC (struct elim_table, NUM_ELIMINABLE_REGS); num_eliminable = 0; - --[[gcc-8.3/gcc/XCNEWVEC()]] for (ep = reg_eliminate, ep1 = reg_eliminate_1; ep < ®_eliminate[NUM_ELIMINABLE_REGS]; ep++, ep1++) { ep->from = ep1->from; ep->to = ep1->to; ep->can_eliminate = ep->can_eliminate_previous = (targetm.can_eliminate (ep->from, ep->to) && ! (ep->to == STACK_POINTER_REGNUM && frame_pointer_needed && (! SUPPORTS_STACK_ALIGNMENT || ! stack_realign_fp))); } - --can_eliminate は TARGET_CAN_ELIMINATE で初期化されている。 --targetm.can_eliminate は TARGET_CAN_ELIMINATE で初期化されている。 ---riscv の場合 riscv_can_eliminate --[[gcc-8.3/gcc/reg_eliminate(global)]] --[[gcc-8.3/gcc/reg_eliminate_1(global)]] --[[gcc-8.3/gcc/targetm(global)]] --[[gcc-8.3/gcc/riscv_can_eliminate()]] /* Count the number of eliminable registers and build the FROM and TO REG rtx's. Note that code in gen_rtx_REG will cause, e.g., gen_rtx_REG (Pmode, STACK_POINTER_REGNUM) to equal stack_pointer_rtx. We depend on this. */ for (ep = reg_eliminate; ep < ®_eliminate[NUM_ELIMINABLE_REGS]; ep++) { num_eliminable += ep->can_eliminate; ep->from_rtx = gen_rtx_REG (Pmode, ep->from); ep->to_rtx = gen_rtx_REG (Pmode, ep->to); } } - --[[gcc-8.3/gcc/gen_rtx_REG()]] -from と to は reg_eliminate_1 の値で初期化されている。 --riscv の場合 from 64, to 2 など --64 はなんだろ?, 2 は sp ---[[gcc-8.3/gcc/reg_eliminate_1(global)]] ---[[gcc-8.3/gcc/REGISTER_NAMES]] ---[[gcc-8.3/gcc/ADDITIONAL_REGISTER_NAMES]] *コメント [#t73bdc0b]