From dc782dcd16b10eb6b4d083222228f8cd1ac52ac1 Mon Sep 17 00:00:00 2001 From: Kazu Hirata Date: Sun, 5 Mar 2006 05:59:55 +0000 Subject: [PATCH] rtlanal.c (replace_reg): Remove. * rtlanal.c (replace_reg): Remove. * rtl.h: Remove the prototype for replace_reg. From-SVN: r111730 --- gcc/ChangeLog | 5 +++ gcc/rtl.h | 1 - gcc/rtlanal.c | 100 -------------------------------------------------- 3 files changed, 5 insertions(+), 101 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 5491d5b2861..a5f0a1809e1 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2006-03-05 Kazu Hirata + + * rtlanal.c (replace_reg): Remove. + * rtl.h: Remove the prototype for replace_reg. + 2006-03-05 Kazu Hirata * regclass.c (reg_scan_update): Remove. diff --git a/gcc/rtl.h b/gcc/rtl.h index 3d182f52917..47d7b0d8922 100644 --- a/gcc/rtl.h +++ b/gcc/rtl.h @@ -1723,7 +1723,6 @@ extern int may_trap_after_code_motion_p (rtx); extern int may_trap_or_fault_p (rtx); extern int inequality_comparisons_p (rtx); extern rtx replace_rtx (rtx, rtx, rtx); -extern rtx replace_regs (rtx, rtx *, unsigned int, int); extern int replace_label (rtx *, void *); extern int rtx_referenced_p (rtx, rtx); extern bool tablejump_p (rtx, rtx *, rtx *); diff --git a/gcc/rtlanal.c b/gcc/rtlanal.c index d740ed5b123..9292a4bb9bb 100644 --- a/gcc/rtlanal.c +++ b/gcc/rtlanal.c @@ -2371,106 +2371,6 @@ replace_rtx (rtx x, rtx from, rtx to) return x; } -/* Throughout the rtx X, replace many registers according to REG_MAP. - Return the replacement for X (which may be X with altered contents). - REG_MAP[R] is the replacement for register R, or 0 for don't replace. - NREGS is the length of REG_MAP; regs >= NREGS are not mapped. - - We only support REG_MAP entries of REG or SUBREG. Also, hard registers - should not be mapped to pseudos or vice versa since validate_change - is not called. - - If REPLACE_DEST is 1, replacements are also done in destinations; - otherwise, only sources are replaced. */ - -rtx -replace_regs (rtx x, rtx *reg_map, unsigned int nregs, int replace_dest) -{ - enum rtx_code code; - int i; - const char *fmt; - - if (x == 0) - return x; - - code = GET_CODE (x); - switch (code) - { - case SCRATCH: - case PC: - case CC0: - case CONST_INT: - case CONST_DOUBLE: - case CONST_VECTOR: - case CONST: - case SYMBOL_REF: - case LABEL_REF: - return x; - - case REG: - /* Verify that the register has an entry before trying to access it. */ - if (REGNO (x) < nregs && reg_map[REGNO (x)] != 0) - { - /* SUBREGs can't be shared. Always return a copy to ensure that if - this replacement occurs more than once then each instance will - get distinct rtx. */ - if (GET_CODE (reg_map[REGNO (x)]) == SUBREG) - return copy_rtx (reg_map[REGNO (x)]); - return reg_map[REGNO (x)]; - } - return x; - - case SUBREG: - /* Prevent making nested SUBREGs. */ - if (REG_P (SUBREG_REG (x)) && REGNO (SUBREG_REG (x)) < nregs - && reg_map[REGNO (SUBREG_REG (x))] != 0 - && GET_CODE (reg_map[REGNO (SUBREG_REG (x))]) == SUBREG) - { - rtx map_val = reg_map[REGNO (SUBREG_REG (x))]; - return simplify_gen_subreg (GET_MODE (x), map_val, - GET_MODE (SUBREG_REG (x)), - SUBREG_BYTE (x)); - } - break; - - case SET: - if (replace_dest) - SET_DEST (x) = replace_regs (SET_DEST (x), reg_map, nregs, 0); - - else if (MEM_P (SET_DEST (x)) - || GET_CODE (SET_DEST (x)) == STRICT_LOW_PART) - /* Even if we are not to replace destinations, replace register if it - is CONTAINED in destination (destination is memory or - STRICT_LOW_PART). */ - XEXP (SET_DEST (x), 0) = replace_regs (XEXP (SET_DEST (x), 0), - reg_map, nregs, 0); - else if (GET_CODE (SET_DEST (x)) == ZERO_EXTRACT) - /* Similarly, for ZERO_EXTRACT we replace all operands. */ - break; - - SET_SRC (x) = replace_regs (SET_SRC (x), reg_map, nregs, 0); - return x; - - default: - break; - } - - fmt = GET_RTX_FORMAT (code); - for (i = GET_RTX_LENGTH (code) - 1; i >= 0; i--) - { - if (fmt[i] == 'e') - XEXP (x, i) = replace_regs (XEXP (x, i), reg_map, nregs, replace_dest); - else if (fmt[i] == 'E') - { - int j; - for (j = 0; j < XVECLEN (x, i); j++) - XVECEXP (x, i, j) = replace_regs (XVECEXP (x, i, j), reg_map, - nregs, replace_dest); - } - } - return x; -} - /* Replace occurrences of the old label in *X with the new one. DATA is a REPLACE_LABEL_DATA containing the old and new labels. */ -- 2.30.2