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]

Re: [PATCH] Fix reload bug for SH


On 03/08/09 11:12, Joern Rennecke wrote:
Quoting Andrew Stubbs <ams@codesourcery.com>:
First, you should find an explanation why the ADDR_ADDR reload appears
as a plain RELOAD_FOR_INPUT_ADDRESS reload.

Thanks Joern, it does indeed seem to be a problem with RELOAD_FOR_INPUT_ADDRESS vs. RELOAD_FOR_INPADDR_ADDRESS.


This patch fixes the problem, but I'm not sure why.

More specifically, I don't know whether this is a forgotten case, or whether it's just plain wrong, as is. Clearly this is a rare case on SH, and I suspect there would never be a problem on any architecture with 3 operand instructions, so maybe it is just wrong.

Andrew
2009-08-03  Andrew Stubbs  <ams@codesourcery.com>

	gcc/
	* reload.c (find_reloads_address): Use ADDR_TYPE.

---
 src/gcc-mainline/gcc/reload.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)


diff --git a/src/gcc-mainline/gcc/reload.c b/src/gcc-mainline/gcc/reload.c
index 64024a7..4d50639 100644
--- a/src/gcc-mainline/gcc/reload.c
+++ b/src/gcc-mainline/gcc/reload.c
@@ -5153,7 +5153,8 @@ find_reloads_address (enum machine_mode mode, rtx *memrefloc, rtx ad,
 	  cls = base_reg_class (mode, MEM, GET_CODE (addend));
 	  find_reloads_address_part (XEXP (ad, op_index), 
 				     &XEXP (ad, op_index), cls,
-				     GET_MODE (ad), opnum, type, ind_levels);
+				     GET_MODE (ad), opnum, ADDR_TYPE (type),
+				     ind_levels);
 	  find_reloads_address_1 (mode,
 				  XEXP (ad, 1 - op_index), 1, GET_CODE (ad),
 				  GET_CODE (XEXP (ad, op_index)),

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