diff options
Diffstat (limited to 'gcc/reload1.c')
-rw-r--r-- | gcc/reload1.c | 169 |
1 files changed, 85 insertions, 84 deletions
diff --git a/gcc/reload1.c b/gcc/reload1.c index b9177181bf6..6de93b9b44b 100644 --- a/gcc/reload1.c +++ b/gcc/reload1.c @@ -417,30 +417,30 @@ init_reload () permitted, zero if it is not permitted at all. */ register rtx tem - = gen_rtx (MEM, Pmode, - gen_rtx (PLUS, Pmode, - gen_rtx (REG, Pmode, LAST_VIRTUAL_REGISTER + 1), - GEN_INT (4))); + = gen_rtx_MEM (Pmode, + gen_rtx_PLUS (Pmode, + gen_rtx_REG (Pmode, LAST_VIRTUAL_REGISTER + 1), + GEN_INT (4))); spill_indirect_levels = 0; while (memory_address_p (QImode, tem)) { spill_indirect_levels++; - tem = gen_rtx (MEM, Pmode, tem); + tem = gen_rtx_MEM (Pmode, tem); } /* See if indirect addressing is valid for (MEM (SYMBOL_REF ...)). */ - tem = gen_rtx (MEM, Pmode, gen_rtx (SYMBOL_REF, Pmode, "foo")); + tem = gen_rtx_MEM (Pmode, gen_rtx_SYMBOL_REF (Pmode, "foo")); indirect_symref_ok = memory_address_p (QImode, tem); /* See if reg+reg is a valid (and offsettable) address. */ for (i = 0; i < FIRST_PSEUDO_REGISTER; i++) { - tem = gen_rtx (PLUS, Pmode, - gen_rtx (REG, Pmode, HARD_FRAME_POINTER_REGNUM), - gen_rtx (REG, Pmode, i)); + tem = gen_rtx_PLUS (Pmode, + gen_rtx_REG (Pmode, HARD_FRAME_POINTER_REGNUM), + gen_rtx_REG (Pmode, i)); /* This way, we make sure that reg+reg is an offsettable address. */ tem = plus_constant (tem, 4); @@ -752,8 +752,8 @@ reload (first, global, dumpfile) 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); + ep->from_rtx = gen_rtx_REG (Pmode, ep->from); + ep->to_rtx = gen_rtx_REG (Pmode, ep->to); } num_labels = max_label_num () - get_first_label_num (); @@ -2557,9 +2557,9 @@ alter_reg (i, from_reg) below. */ adjust = GET_MODE_SIZE (mode) - total_size; if (adjust) - stack_slot = gen_rtx (MEM, mode_for_size (total_size - * BITS_PER_UNIT, - MODE_INT, 1), + stack_slot = gen_rtx_MEM (mode_for_size (total_size + * BITS_PER_UNIT, + MODE_INT, 1), plus_constant (XEXP (x, 0), adjust)); } spill_stack_slot[from_reg] = stack_slot; @@ -2575,7 +2575,7 @@ alter_reg (i, from_reg) wrong mode, make a new stack slot. */ if (adjust != 0 || GET_MODE (x) != GET_MODE (regno_reg_rtx[i])) { - x = gen_rtx (MEM, GET_MODE (regno_reg_rtx[i]), + x = gen_rtx_MEM (GET_MODE (regno_reg_rtx[i]), plus_constant (XEXP (x, 0), adjust)); RTX_UNCHANGING_P (x) = RTX_UNCHANGING_P (regno_reg_rtx[i]); } @@ -2917,9 +2917,9 @@ eliminate_regs (x, mem_mode, insn) && INTVAL (XEXP (x, 1)) == - ep->previous_offset) return ep->to_rtx; else - return gen_rtx (PLUS, Pmode, ep->to_rtx, - plus_constant (XEXP (x, 1), - ep->previous_offset)); + return gen_rtx_PLUS (Pmode, ep->to_rtx, + plus_constant (XEXP (x, 1), + ep->previous_offset)); } /* If the register is not eliminable, we are done since the other @@ -2968,7 +2968,7 @@ eliminate_regs (x, mem_mode, insn) turn a PLUS into something else. We might try to do so here for an addition of 0 if we aren't optimizing. */ if (! mem_mode && GET_CODE (new) != PLUS) - return gen_rtx (PLUS, GET_MODE (x), new, const0_rtx); + return gen_rtx_PLUS (GET_MODE (x), new, const0_rtx); else return new; } @@ -2995,7 +2995,7 @@ eliminate_regs (x, mem_mode, insn) ep->ref_outside_mem = 1; return - plus_constant (gen_rtx (MULT, Pmode, ep->to_rtx, XEXP (x, 1)), + plus_constant (gen_rtx_MULT (Pmode, ep->to_rtx, XEXP (x, 1)), ep->previous_offset * INTVAL (XEXP (x, 1))); } @@ -3018,7 +3018,7 @@ eliminate_regs (x, mem_mode, insn) = XEXP (x, 1) ? eliminate_regs (XEXP (x, 1), mem_mode, insn) : 0; if (new0 != XEXP (x, 0) || new1 != XEXP (x, 1)) - return gen_rtx (code, GET_MODE (x), new0, new1); + return gen_rtx_fmt_ee (code, GET_MODE (x), new0, new1); } return x; @@ -3028,7 +3028,7 @@ eliminate_regs (x, mem_mode, insn) { new = eliminate_regs (XEXP (x, 0), mem_mode, insn); if (new != XEXP (x, 0)) - x = gen_rtx (EXPR_LIST, REG_NOTE_KIND (x), new, XEXP (x, 1)); + x = gen_rtx_EXPR_LIST (REG_NOTE_KIND (x), new, XEXP (x, 1)); } /* ... fall through ... */ @@ -3041,7 +3041,7 @@ eliminate_regs (x, mem_mode, insn) { new = eliminate_regs (XEXP (x, 1), mem_mode, insn); if (new != XEXP (x, 1)) - return gen_rtx (GET_CODE (x), GET_MODE (x), XEXP (x, 0), new); + return gen_rtx_fmt_ee (GET_CODE (x), GET_MODE (x), XEXP (x, 0), new); } return x; @@ -3077,7 +3077,7 @@ eliminate_regs (x, mem_mode, insn) case FFS: new = eliminate_regs (XEXP (x, 0), mem_mode, insn); if (new != XEXP (x, 0)) - return gen_rtx (code, GET_MODE (x), new); + return gen_rtx_fmt_e (code, GET_MODE (x), new); return x; case SUBREG: @@ -3109,7 +3109,7 @@ eliminate_regs (x, mem_mode, insn) insn so that delete_output_reload will do the right thing. */ if (insn != 0 && GET_CODE (insn) != EXPR_LIST && GET_CODE (insn) != INSN_LIST) - emit_insn_before (gen_rtx (USE, VOIDmode, SUBREG_REG (x)), + emit_insn_before (gen_rtx_USE (VOIDmode, SUBREG_REG (x)), insn); } } @@ -3160,7 +3160,7 @@ eliminate_regs (x, mem_mode, insn) return new; } else - return gen_rtx (SUBREG, GET_MODE (x), new, SUBREG_WORD (x)); + return gen_rtx_SUBREG (GET_MODE (x), new, SUBREG_WORD (x)); } return x; @@ -3175,7 +3175,7 @@ eliminate_regs (x, mem_mode, insn) new = eliminate_regs (XEXP (x, 0), mem_mode, insn); if (new != XEXP (x, 0)) - return gen_rtx (code, GET_MODE (x), new); + return gen_rtx_fmt_e (code, GET_MODE (x), new); return x; case CLOBBER: @@ -3188,7 +3188,7 @@ eliminate_regs (x, mem_mode, insn) new = eliminate_regs (XEXP (x, 0), mem_mode, insn); if (new != XEXP (x, 0)) - return gen_rtx (code, GET_MODE (x), new); + return gen_rtx_fmt_e (code, GET_MODE (x), new); return x; case ASM_OPERANDS: @@ -3221,12 +3221,13 @@ eliminate_regs (x, mem_mode, insn) if (new_asm_operands_vec == old_asm_operands_vec) return x; - new = gen_rtx (ASM_OPERANDS, VOIDmode, ASM_OPERANDS_TEMPLATE (x), - ASM_OPERANDS_OUTPUT_CONSTRAINT (x), - ASM_OPERANDS_OUTPUT_IDX (x), new_asm_operands_vec, - ASM_OPERANDS_INPUT_CONSTRAINT_VEC (x), - ASM_OPERANDS_SOURCE_FILE (x), - ASM_OPERANDS_SOURCE_LINE (x)); + new = gen_rtx_ASM_OPERANDS (VOIDmode, ASM_OPERANDS_TEMPLATE (x), + ASM_OPERANDS_OUTPUT_CONSTRAINT (x), + ASM_OPERANDS_OUTPUT_IDX (x), + new_asm_operands_vec, + ASM_OPERANDS_INPUT_CONSTRAINT_VEC (x), + ASM_OPERANDS_SOURCE_FILE (x), + ASM_OPERANDS_SOURCE_LINE (x)); new->volatil = x->volatil; return new; } @@ -3283,10 +3284,10 @@ eliminate_regs (x, mem_mode, insn) if (GET_CODE (SET_DEST (x)) == REG && GET_CODE (new0) == MEM && insn != 0 && GET_CODE (insn) != EXPR_LIST && GET_CODE (insn) != INSN_LIST) - emit_insn_after (gen_rtx (CLOBBER, VOIDmode, SET_DEST (x)), insn); + emit_insn_after (gen_rtx_CLOBBER (VOIDmode, SET_DEST (x)), insn); if (new0 != SET_DEST (x) || new1 != SET_SRC (x)) - return gen_rtx (SET, VOIDmode, new0, new1); + return gen_rtx_SET (VOIDmode, new0, new1); } return x; @@ -3304,7 +3305,7 @@ eliminate_regs (x, mem_mode, insn) new = eliminate_regs (XEXP (x, 0), GET_MODE (x), insn); if (new != XEXP (x, 0)) { - new = gen_rtx (MEM, GET_MODE (x), new); + new = gen_rtx_MEM (GET_MODE (x), new); new->volatil = x->volatil; new->unchanging = x->unchanging; new->in_struct = x->in_struct; @@ -3498,8 +3499,9 @@ eliminate_regs_in_insn (insn, replace) /* We assume here that we don't need a PARALLEL of any CLOBBERs for this assignment. There's not much we can do if we do need it. */ - PATTERN (insn) = gen_rtx (SET, VOIDmode, - SET_DEST (old_set), ep->to_rtx); + PATTERN (insn) = gen_rtx_SET (VOIDmode, + SET_DEST (old_set), + ep->to_rtx); INSN_CODE (insn) = -1; val = 1; goto done; @@ -5160,7 +5162,7 @@ allocate_reload_reg (r, insn, last_reload, noerror) if (new == 0 || GET_MODE (new) != reload_mode[r]) spill_reg_rtx[i] = new - = gen_rtx (REG, reload_mode[r], spill_regs[i]); + = gen_rtx_REG (reload_mode[r], spill_regs[i]); regno = true_regnum (new); @@ -5617,7 +5619,7 @@ choose_reload_regs (insn, avoid_return_reg) address and not all machines support SUBREGs there. */ regno = REGNO (SUBREG_REG (equiv)) + SUBREG_WORD (equiv); - equiv = gen_rtx (REG, reload_mode[r], regno); + equiv = gen_rtx_REG (reload_mode[r], regno); } else abort (); @@ -6176,12 +6178,12 @@ emit_reload_insns (insn) must always be a REG here. */ if (GET_MODE (reloadreg) != mode) - reloadreg = gen_rtx (REG, mode, REGNO (reloadreg)); + reloadreg = gen_rtx_REG (mode, REGNO (reloadreg)); while (GET_CODE (oldequiv) == SUBREG && GET_MODE (oldequiv) != mode) oldequiv = SUBREG_REG (oldequiv); if (GET_MODE (oldequiv) != VOIDmode && mode != GET_MODE (oldequiv)) - oldequiv = gen_rtx (SUBREG, mode, oldequiv, 0); + oldequiv = gen_rtx_SUBREG (mode, oldequiv, 0); /* Switch to the right place to emit the reload insns. */ switch (reload_when_needed[j]) @@ -6364,8 +6366,8 @@ emit_reload_insns (insn) oldequiv = old, real_oldequiv = real_old; else second_reload_reg - = gen_rtx (REG, new_mode, - REGNO (second_reload_reg)); + = gen_rtx_REG (new_mode, + REGNO (second_reload_reg)); } } } @@ -6432,9 +6434,9 @@ emit_reload_insns (insn) && reg_overlap_mentioned_for_reload_p (second_reload_reg, PATTERN (prev))) { - REG_NOTES (prev) = gen_rtx (EXPR_LIST, REG_DEAD, - second_reload_reg, - REG_NOTES (prev)); + REG_NOTES (prev) = gen_rtx_EXPR_LIST (REG_DEAD, + second_reload_reg, + REG_NOTES (prev)); break; } } @@ -6475,8 +6477,8 @@ emit_reload_insns (insn) || reload_when_needed[j] == RELOAD_FOR_INPUT) && ! dead_or_set_p (insn, reloadreg)) REG_NOTES (insn) - = gen_rtx (EXPR_LIST, REG_DEAD, - reloadreg, REG_NOTES (insn)); + = gen_rtx_EXPR_LIST (REG_DEAD, + reloadreg, REG_NOTES (insn)); } /* When we inherit a reload, the last marked death of the reload reg @@ -6548,9 +6550,9 @@ emit_reload_insns (insn) && reg_overlap_mentioned_for_reload_p (oldequiv_reg, PATTERN (prev1))) { - REG_NOTES (prev1) = gen_rtx (EXPR_LIST, REG_DEAD, - oldequiv_reg, - REG_NOTES (prev1)); + REG_NOTES (prev1) = gen_rtx_EXPR_LIST (REG_DEAD, + oldequiv_reg, + REG_NOTES (prev1)); break; } remove_death (REGNO (oldequiv_reg), prev); @@ -6657,11 +6659,11 @@ emit_reload_insns (insn) error_for_asm (insn, "output operand is constant in `asm'"); /* Prevent crash--use something we know is valid. */ mode = word_mode; - old = gen_rtx (REG, mode, REGNO (reloadreg)); + old = gen_rtx_REG (mode, REGNO (reloadreg)); } if (GET_MODE (reloadreg) != mode) - reloadreg = gen_rtx (REG, mode, REGNO (reloadreg)); + reloadreg = gen_rtx_REG (mode, REGNO (reloadreg)); #ifdef SECONDARY_OUTPUT_RELOAD_CLASS @@ -6702,7 +6704,7 @@ emit_reload_insns (insn) = reload_secondary_out_icode[secondary_reload]; if (GET_MODE (reloadreg) != mode) - reloadreg = gen_rtx (REG, mode, REGNO (reloadreg)); + reloadreg = gen_rtx_REG (mode, REGNO (reloadreg)); if (tertiary_icode != CODE_FOR_nothing) { @@ -6757,8 +6759,8 @@ emit_reload_insns (insn) if (GET_RTX_CLASS (GET_CODE (p)) == 'i' && reg_overlap_mentioned_for_reload_p (reloadreg, PATTERN (p))) - REG_NOTES (p) = gen_rtx (EXPR_LIST, REG_DEAD, - reloadreg, REG_NOTES (p)); + REG_NOTES (p) = gen_rtx_EXPR_LIST (REG_DEAD, + reloadreg, REG_NOTES (p)); #ifdef SECONDARY_OUTPUT_RELOAD_CLASS if (! special && second_reloadreg @@ -6767,8 +6769,9 @@ emit_reload_insns (insn) if (GET_RTX_CLASS (GET_CODE (p)) == 'i' && reg_overlap_mentioned_for_reload_p (second_reloadreg, PATTERN (p))) - REG_NOTES (p) = gen_rtx (EXPR_LIST, REG_DEAD, - second_reloadreg, REG_NOTES (p)); + REG_NOTES (p) = gen_rtx_EXPR_LIST (REG_DEAD, + second_reloadreg, + REG_NOTES (p)); #endif #endif /* Look at all insns we emitted, just to be safe. */ @@ -6956,9 +6959,8 @@ emit_reload_insns (insn) for (k = 1; k < nnr; k++) reg_last_reload_reg[nregno + k] = (nr == nnr - ? gen_rtx (REG, - reg_raw_mode[REGNO (reload_reg_rtx[r]) + k], - REGNO (reload_reg_rtx[r]) + k) + ? gen_rtx_REG (reg_raw_mode[REGNO (reload_reg_rtx[r]) + k], + REGNO (reload_reg_rtx[r]) + k) : 0); /* Now do the inverse operation. */ @@ -7000,9 +7002,8 @@ emit_reload_insns (insn) for (k = 1; k < nnr; k++) reg_last_reload_reg[nregno + k] = (nr == nnr - ? gen_rtx (REG, - reg_raw_mode[REGNO (reload_reg_rtx[r]) + k], - REGNO (reload_reg_rtx[r]) + k) + ? gen_rtx_REG (reg_raw_mode[REGNO (reload_reg_rtx[r]) + k], + REGNO (reload_reg_rtx[r]) + k) : 0); /* Unless we inherited this reload, show we haven't @@ -7156,9 +7157,9 @@ gen_reload (out, in, opnum, type) tem = op0, op0 = op1, op1 = tem; if (op0 != XEXP (in, 0) || op1 != XEXP (in, 1)) - in = gen_rtx (PLUS, GET_MODE (in), op0, op1); + in = gen_rtx_PLUS (GET_MODE (in), op0, op1); - insn = emit_insn (gen_rtx (SET, VOIDmode, out, in)); + insn = emit_insn (gen_rtx_SET (VOIDmode, out, in)); code = recog_memoized (insn); if (code >= 0) @@ -7231,10 +7232,10 @@ gen_reload (out, in, opnum, type) rtx loc = get_secondary_mem (in, GET_MODE (out), opnum, type); if (GET_MODE (loc) != GET_MODE (out)) - out = gen_rtx (REG, GET_MODE (loc), REGNO (out)); + out = gen_rtx_REG (GET_MODE (loc), REGNO (out)); if (GET_MODE (loc) != GET_MODE (in)) - in = gen_rtx (REG, GET_MODE (loc), REGNO (in)); + in = gen_rtx_REG (GET_MODE (loc), REGNO (in)); gen_reload (loc, in, opnum, type); gen_reload (out, loc, opnum, type); @@ -7252,7 +7253,7 @@ gen_reload (out, in, opnum, type) /* Otherwise, just write (set OUT IN) and hope for the best. */ else - emit_insn (gen_rtx (SET, VOIDmode, out, in)); + emit_insn (gen_rtx_SET (VOIDmode, out, in)); /* Return the first insn emitted. We can not just return get_last_insn, because there may have @@ -7408,9 +7409,9 @@ inc_for_reload (reloadreg, value, inc_amount) in gen_reload. */ last = get_last_insn (); - add_insn = emit_insn (gen_rtx (SET, VOIDmode, incloc, - gen_rtx (PLUS, GET_MODE (incloc), - incloc, inc))); + add_insn = emit_insn (gen_rtx_SET (VOIDmode, incloc, + gen_rtx_PLUS (GET_MODE (incloc), + incloc, inc))); code = recog_memoized (add_insn); if (code >= 0) @@ -7888,11 +7889,11 @@ reload_cse_regs (first) /* We pass this to reload_cse_invalidate_mem to invalidate all of memory for a non-const call instruction. */ - callmem = gen_rtx (MEM, BLKmode, const0_rtx); + callmem = gen_rtx_MEM (BLKmode, const0_rtx); /* This is used in reload_cse_invalidate_regno to avoid consing a new REG in a loop in that function. */ - invalidate_regno_rtx = gen_rtx (REG, VOIDmode, 0); + invalidate_regno_rtx = gen_rtx_REG (VOIDmode, 0); for (insn = first; insn; insn = NEXT_INSN (insn)) { @@ -8213,7 +8214,7 @@ reload_cse_simplify_set (set, insn) pop_obstacks (); validated = validate_change (insn, &SET_SRC (set), - gen_rtx (REG, dest_mode, i), 1); + gen_rtx_REG (dest_mode, i), 1); /* Go back to the obstack we are using for temporary storage. */ @@ -8368,7 +8369,7 @@ reload_cse_simplify_operands (insn) replacement register if we don't have one for this alternative yet. */ if (op_alt_regno[i][j] == -1 - && reg_fits_class_p (gen_rtx (REG, mode, regno), class, + && reg_fits_class_p (gen_rtx_REG (mode, regno), class, 0, mode)) { alternative_nregs[j]++; @@ -8435,7 +8436,7 @@ reload_cse_simplify_operands (insn) reload_cse_no_longer_dead (op_alt_regno[i][j], mode); validate_change (insn, recog_operand_loc[i], - gen_rtx (REG, mode, op_alt_regno[i][j]), 1); + gen_rtx_REG (mode, op_alt_regno[i][j]), 1); } for (i = insn_n_dups[insn_code_number] - 1; i >= 0; i--) @@ -8448,7 +8449,7 @@ reload_cse_simplify_operands (insn) reload_cse_no_longer_dead (op_alt_regno[op][j], mode); validate_change (insn, recog_dup_loc[i], - gen_rtx (REG, mode, op_alt_regno[op][j]), 1); + gen_rtx_REG (mode, op_alt_regno[op][j]), 1); } /* Go back to the obstack we are using for temporary @@ -8592,12 +8593,12 @@ reload_cse_record_set (set, body) else tmp = gen_lowpart_common (dest_mode, XEXP (x, 0)); if (tmp) - reg_values[dreg] = gen_rtx (EXPR_LIST, dest_mode, tmp, - reg_values[dreg]); + reg_values[dreg] = gen_rtx_EXPR_LIST (dest_mode, tmp, + reg_values[dreg]); } } else - reg_values[dreg] = gen_rtx (EXPR_LIST, dest_mode, src, NULL_RTX); + reg_values[dreg] = gen_rtx_EXPR_LIST (dest_mode, src, NULL_RTX); /* We've changed DREG, so invalidate any values held by other registers that depend upon it. */ @@ -8616,7 +8617,7 @@ reload_cse_record_set (set, body) /* If we're storing a register to memory, add DEST to the list in REG_VALUES. */ if (sreg >= 0 && ! side_effects_p (dest)) - reg_values[sreg] = gen_rtx (EXPR_LIST, dest_mode, dest, + reg_values[sreg] = gen_rtx_EXPR_LIST (dest_mode, dest, reg_values[sreg]); } else |