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] Fix PR target/37270


Hi,

PR target/37270 is a yet another R0_REGS spill failure on sh4.
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=37270

The .ira dump says:

Reloads for insn # 23
Reload 0: reload_in (SI) = (const_int 4 [0x4])
	R0_REGS, RELOAD_FOR_OPERAND_ADDRESS (opnum = 1)
	reload_in_reg: (const_int 4 [0x4])
Reload 1: reload_in (SF) = (mem/c:SF (plus:SI (reg/f:SI 15 r15)
                                                        (const_int 4 [0x4])) [5 D.1218+0 S4 A32])
	GENERAL_REGS, RELOAD_FOR_INPUT (opnum = 1), optional, can't combine
	reload_in_reg: (reg:SF 163 [ D.1218 ])

The above reload 0 is generated with push_reload called from
SH's LEGITIMIZE_RELOAD_ADDRESS for the address expression
(plus (reg: 15 r15) (const_int 4)) for SFmode.  It seems
that it's enough for the old allocator but doesn't work well
with the new allocator.  The attached patch is to fix this.
It's tested with bootstrap and the top level "make -k check"
for sh4-unknown-linux-gnu with no new failures.  I've also run
SCiBE on that target and confirmed that there is no visible
difference both in code size and in runtime performance.
Applied on trunk.

Regards,
	kaz
--
2008-08-30  Kaz Kojima  <kkojima@gcc.gnu.org>

	PR target/37270
	* config/sh/sh.h (LEGITIMIZE_RELOAD_ADDRESS): Generate
	the reload address with the index register for SFmode
	access with a displacement.

diff -uprN ORIG/ira/gcc/config/sh/sh.h LOCAL/ira/gcc/config/sh/sh.h
--- ORIG/ira/gcc/config/sh/sh.h	2008-08-29 09:12:04.000000000 +0900
+++ LOCAL/ira/gcc/config/sh/sh.h	2008-08-29 11:20:38.000000000 +0900
@@ -2613,8 +2613,8 @@ struct sh_args {
       if (TARGET_SH2E && MODE == SFmode)				\
 	{								\
 	  X = copy_rtx (X);						\
-	  push_reload (index_rtx, NULL_RTX, &XEXP (X, 1), NULL,		\
-		       R0_REGS, Pmode, VOIDmode, 0, 0, (OPNUM),		\
+	  push_reload (X, NULL_RTX, &X, NULL,				\
+		       BASE_REG_CLASS, Pmode, VOIDmode, 0, 0, (OPNUM),	\
 		       (TYPE));						\
 	  goto WIN;							\
 	}								\


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