From e27a1019c5cac8377587a3528d0b724b680ea646 Mon Sep 17 00:00:00 2001 From: Kaz Kojima Date: Fri, 13 Jul 2007 05:49:33 +0000 Subject: [PATCH] sh.c (mark_use): Remove. * config/sh/sh.c (mark_use): Remove. From-SVN: r126611 --- gcc/ChangeLog | 4 +++ gcc/config/sh/sh.c | 81 ---------------------------------------------- 2 files changed, 4 insertions(+), 81 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 806a0579736..380c480a32f 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,7 @@ +2007-07-13 Kaz Kojima + + * config/sh/sh.c (mark_use): Remove. + 2007-07-12 Paul Brook * config/arm/arm.c (thumb1_compute_save_reg_mask): Make sure scratch diff --git a/gcc/config/sh/sh.c b/gcc/config/sh/sh.c index a7347eefccb..ae1f916dc95 100644 --- a/gcc/config/sh/sh.c +++ b/gcc/config/sh/sh.c @@ -182,7 +182,6 @@ static rtx push (int); static void pop (int); static void push_regs (HARD_REG_SET *, int); static int calc_live_regs (HARD_REG_SET *); -static void mark_use (rtx, rtx *); static HOST_WIDE_INT rounded_frame_size (int); static rtx mark_constant_pool_use (rtx); const struct attribute_spec sh_attribute_table[]; @@ -8378,86 +8377,6 @@ expand_df_binop (rtx (*fun) (rtx, rtx, rtx, rtx), rtx *operands) get_fpscr_rtx ())); } -/* ??? gcc does flow analysis strictly after common subexpression - elimination. As a result, common subexpression elimination fails - when there are some intervening statements setting the same register. - If we did nothing about this, this would hurt the precision switching - for SH4 badly. There is some cse after reload, but it is unable to - undo the extra register pressure from the unused instructions, and - it cannot remove auto-increment loads. - - A C code example that shows this flow/cse weakness for (at least) SH - and sparc (as of gcc ss-970706) is this: - -double -f(double a) -{ - double d; - d = 0.1; - a += d; - d = 1.1; - d = 0.1; - a *= d; - return a; -} - - So we add another pass before common subexpression elimination, to - remove assignments that are dead due to a following assignment in the - same basic block. */ - -static void -mark_use (rtx x, rtx *reg_set_block) -{ - enum rtx_code code; - - if (! x) - return; - code = GET_CODE (x); - switch (code) - { - case REG: - { - int regno = REGNO (x); - int nregs = (regno < FIRST_PSEUDO_REGISTER - ? HARD_REGNO_NREGS (regno, GET_MODE (x)) - : 1); - do - { - reg_set_block[regno + nregs - 1] = 0; - } - while (--nregs); - break; - } - case SET: - { - rtx dest = SET_DEST (x); - - if (GET_CODE (dest) == SUBREG) - dest = SUBREG_REG (dest); - if (GET_CODE (dest) != REG) - mark_use (dest, reg_set_block); - mark_use (SET_SRC (x), reg_set_block); - break; - } - case CLOBBER: - break; - default: - { - const char *fmt = GET_RTX_FORMAT (code); - int i, j; - for (i = GET_RTX_LENGTH (code) - 1; i >= 0; i--) - { - if (fmt[i] == 'e') - mark_use (XEXP (x, i), reg_set_block); - else if (fmt[i] == 'E') - for (j = XVECLEN (x, i) - 1; j >= 0; j--) - mark_use (XVECEXP (x, i, j), reg_set_block); - } - break; - } - } -} - static rtx get_free_reg (HARD_REG_SET); /* This function returns a register to use to load the address to load -- 2.30.2