This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[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);
 }
 


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]