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: RFC: remove find_replacement. (pr24912 / pr25335)


Joern Rennecke wrote:

Bernd Schmidt wrote:

Ulrich, can you retry Joern's original patch on your machine?


Note that the count_occurence check in emit_input_reloads_insns doesn't do what it is
supposed to after subst_reloads. We expected to see (at least) one occurence for the
reload under consideration. After subst_reloads, there should be zero occurences.
Likewise in delete_output_reload.

I withdraw the patch.


It is actually more complicated with delete_output_reload. We compare the number of
inherited instances with the number of apparent instances - this won't work any more after
subst_reloads. I think we should really be able to do a better job at noting and using
information in the reloads so that we can tell about all non-obvious uses without needing
to take USEs in front of the currently reloaded insn into account. But such work is probably
better done in the relaoad branch.


We already know how to muddle along in the meantime using find_replacement.
Something along the lines of the attached patch (not tested yet).

2006-02-09  J"orn Rennecke <joern.rennecke@st.com>

	* reload1.c (gen_reload): Also use find_replacement in UNARY_P case.

Index: reload1.c
===================================================================
/usr/bin/diff -p -d -F^( -u -L reload1.c	(revision 110809) -L reload1.c	(working copy) .svn/text-base/reload1.c.svn-base reload1.c
--- reload1.c	(revision 110809)
+++ reload1.c	(working copy)
@@ -7721,6 +7721,10 @@ gen_reload (rtx out, rtx in, int opnum, 
       rtx out_moded;
       rtx set;
 
+      op1 = find_replacement (&XEXP (in, 0));
+      if (op1 != XEXP (in, 0))
+	in = gen_rtx_fmt_e (GET_CODE (in), GET_MODE (in), op1));
+
       /* First, try a plain SET.  */
       set = emit_insn_if_valid_for_reload (gen_rtx_SET (VOIDmode, out, in));
       if (set)
@@ -7729,7 +7733,6 @@ gen_reload (rtx out, rtx in, int opnum, 
       /* If that failed, move the inner operand to the reload
 	 register, and try the same unop with the inner expression
 	 replaced with the reload register.  */
-      op1 = XEXP (in, 0);
 
       if (GET_MODE (op1) != GET_MODE (out))
 	out_moded = gen_rtx_REG (GET_MODE (op1), REGNO (out));

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