Commit 10050f74 by Kaz Kojima

re PR rtl-optimization/28011 ([SH] g++ generates wrong code, if…

re PR rtl-optimization/28011 ([SH] g++ generates wrong code, if '-fno-exceptions' and '-O' options are specified)

	PR rtl-optimization/28011
	* 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.

From-SVN: r124557
parent b4aaa77b
2007-05-08 Kaz Kojima <kkojima@gcc.gnu.org>
PR rtl-optimization/28011
* 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.
2007-05-08 Kazu Hirata <kazu@codesourcery.com>
* emit-rtl.c (unshare_all_rtl_1): Don't copy DECL_RTL. Don't
......
......@@ -1180,7 +1180,7 @@ push_reload (rtx in, rtx out, rtx *inloc, rtx *outloc,
/* 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;
......@@ -6516,7 +6516,8 @@ reg_overlap_mentioned_for_reload_p (rtx x, rtx in)
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));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment