[patch RFC] SH: Use FRAME_GROWS_DOWNWARD

Kaz Kojima kkojima@rr.iij4u.or.jp
Sun Jul 31 00:43:00 GMT 2005


Joern RENNECKE <joern.rennecke@st.com> wrote:
> The movti expander triggered a latent reload bug, and the USEs of wide 
> registers
> confused mode switching.  I finally got a set of patches that passes 
> regression tests
> for the sh-elf / sh64-elf simulator targets, you can find them in the
> apply-reload-diff-20050728 attachment of PR middle-end/23135
> ( http://gcc.gnu.org/bugzilla/attachment.cgi?id=9385&action=view ) .
> 
> However, when I now look at the execute/simd-1.c code for -m4 -ml -O1, 
> it is more
> than twice the size of what it is without these patches.  Before, the 
> pseudo where the
> result of the divisions foes was allocated to r0, now it is reloaded.  
> This is probably
> due to some heuristic being perturbed by the existence of the movti 
> expander.
> I wonder if this is exceptional, or if more code is affected,

I've run CSiBE with/without your apply-reload-diff-20050728 patch
on sh4-unknown-linux-gnu and seen no difference in the all tests.
I've also compared the sizes of gcc/*.o objects on same target and
there is no difference too.  It seems that simd-1.c is exceptional.

BTW, I've seen a compile time warning:

../../gcc/gcc/mode-switching.c: In function 'create_pre_exit':
../../gcc/gcc/mode-switching.c:268: warning: comparison between signed and unsigned

when bootstrapping on sh4-unknown-linux-gnu with the patch.
The attached is to avoid it.

Regards,
	kaz
--

diff -up gcc/gcc/mode-switching.c.orig gcc/gcc/mode-switching.c
--- gcc/gcc/mode-switching.c.orig	2005-07-30 07:31:02.000000000 +0900
+++ gcc/gcc/mode-switching.c	2005-07-30 17:19:45.000000000 +0900
@@ -233,9 +233,9 @@ create_pre_exit (int n_entities, int *en
 	    && GET_CODE (PATTERN (last_insn)) == USE
 	    && GET_CODE ((ret_reg = XEXP (PATTERN (last_insn), 0))) == REG)
 	  {
-	    int ret_start = REGNO (ret_reg);
+	    unsigned int ret_start = REGNO (ret_reg);
 	    int nregs = hard_regno_nregs[ret_start][GET_MODE (ret_reg)];
-	    int ret_end = ret_start + nregs;
+	    unsigned int ret_end = ret_start + nregs;
 	    int short_block = 0;
 	    int maybe_builtin_apply = 0;
 	    int forced_late_switch = 0;
@@ -246,7 +246,7 @@ create_pre_exit (int n_entities, int *en
 	      {
 		rtx return_copy = PREV_INSN (last_insn);
 		rtx return_copy_pat, copy_reg;
-		int copy_start, copy_num;
+		unsigned int copy_start, copy_num;
 		int j;
 		int is_copy = 0;
 



More information about the Gcc-patches mailing list