This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[patch committed] SH: Avoid useless call of get_free_reg
- From: Kaz Kojima <kkojima at rr dot iij4u dot or dot jp>
- To: gcc-patches at gcc dot gnu dot org
- Date: Fri, 01 Jun 2007 14:01:23 +0900 (JST)
- Subject: [patch committed] SH: Avoid useless call of get_free_reg
Hi,
I've committed the attached patch for SH on trunk.
fpscr_set_from_mem always calls get_free_reg to get a hardware
register for the scratch argument of emit_fpu_switch, but
emit_fpu_switch uses this argument only when no_new_pseudos
is set.
The attached patch is to avoid useless call of get_free_reg.
Tested with bootstrap and the top level "make -k check" with
no new failures on sh4-unknown-linux-gnu.
Regards,
kaz
--
2007-06-01 Kaz Kojima <kkojima@gcc.gnu.org>
* config/sh/sh.c (fpscr_set_from_mem): Call get_free_reg
only after no_new_pseudos.
--- ORIG/trunk/gcc/config/sh/sh.c 2007-05-23 09:23:53.000000000 +0900
+++ LOCAL/trunk/gcc/config/sh/sh.c 2007-06-01 11:19:49.000000000 +0900
@@ -8542,8 +8542,9 @@ fpscr_set_from_mem (int mode, HARD_REG_S
{
enum attr_fp_mode fp_mode = mode;
enum attr_fp_mode norm_mode = ACTUAL_NORMAL_MODE (FP_MODE);
- rtx addr_reg = get_free_reg (regs_live);
+ rtx addr_reg;
+ addr_reg = no_new_pseudos ? get_free_reg (regs_live) : NULL_RTX;
emit_fpu_switch (addr_reg, fp_mode == norm_mode);
}