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 RFA] Backport the fix for PR rtl-optimization/28011 to 4.1/4.2


Hi,

Can we backport the patch for PR rtl-optimization/28011 to 4.1/4.2?
PR 28011 is a reload problem which causes a 4.1/4.2 regression from
4.0 on SH:

http://gcc.gnu.org/ml/gcc-patches/2007-05/msg00476.html

and the patch was applied at May 8 on the trunk.  The attached patch
is for 4.2, though it's literally same as the patch for trunk and
4.1.  The patches are tested with bootstrap and regtested with
"make -k check" for i686-pc-linux-gnu and powerpc-apple-darwin8.9.0
without no new failures on 4.1/4.2 branches.

Regards,
	kaz
--

	PR rtl-optimization/28011
	Backport from mainline.
	* reload.c (push_reload): Set dont_share if IN appears in OUT
	also when IN is a PLUS rtx.
	(reg_overlap_mentioned_for_reload_p): Return true if X and IN
	are same PLUS rtx.

diff -uprN ORIG/gcc-4_2-branch/gcc/reload.c LOCAL/gcc-4_2-branch/gcc/reload.c
--- ORIG/gcc-4_2-branch/gcc/reload.c	2007-04-29 09:17:56.000000000 +0900
+++ LOCAL/gcc-4_2-branch/gcc/reload.c	2007-05-16 11:07:08.000000000 +0900
@@ -1180,7 +1180,7 @@ push_reload (rtx in, rtx out, rtx *inloc
 
   /* If IN appears in OUT, we can't share any input-only reload for IN.  */
   if (in != 0 && out != 0 && MEM_P (out)
-      && (REG_P (in) || MEM_P (in))
+      && (REG_P (in) || MEM_P (in) || GET_CODE (in) == PLUS)
       && reg_overlap_mentioned_for_reload_p (in, XEXP (out, 0)))
     dont_share = 1;
 
@@ -6540,7 +6540,8 @@ reg_overlap_mentioned_for_reload_p (rtx 
       if (REG_P (in))
 	return 0;
       else if (GET_CODE (in) == PLUS)
-	return (reg_overlap_mentioned_for_reload_p (x, XEXP (in, 0))
+	return (rtx_equal_p (x, in)
+		|| reg_overlap_mentioned_for_reload_p (x, XEXP (in, 0))
 		|| reg_overlap_mentioned_for_reload_p (x, XEXP (in, 1)));
       else return (reg_overlap_mentioned_for_reload_p (XEXP (x, 0), in)
 		   || reg_overlap_mentioned_for_reload_p (XEXP (x, 1), in));


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