This is the mail archive of the 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]

Re: Reload inheritance and auto inc/dec

On Sep 14, 2000, Bernd Schmidt <> wrote:

> I believe this is almost right.  However, you want this instead:

> -		    = push_reload (x, x, loc, loc,
> +		    = push_reload (x, x, &XEXP (x_orig, 0), &XEXP (x_orig, 0),

This is indeed better.  It even results in the generation of better
code.  And we can kill the `if' command below, since now we know for
sure that `loc == &XEXP (x_orig, 0)'.

> and the comment is maybe a bit misleading.

In what sense?  Is this rewording any better?

Ok to install, if it doesn't introduce regressions in the testsuite?

Index: gcc/ChangeLog
from  Alexandre Oliva  <>, Bernd Schmidt  <>

	* reload.c (find_reloads_address_1): Generate reloads for auto_inc
	pseudos that refer to the original pseudos, not only to their
	equivalent memory locations.

Index: gcc/reload.c
RCS file: /cvs/gcc/egcs/gcc/reload.c,v
retrieving revision 1.128
diff -u -p -r1.128 reload.c
--- gcc/reload.c 2000/09/11 13:13:00 1.128
+++ gcc/reload.c 2000/09/14 16:59:31
@@ -5276,21 +5276,18 @@ find_reloads_address_1 (mode, x, context
 			&& ((*insn_data[icode].operand[1].predicate)
 			    (equiv, Pmode))))
-		  loc = &XEXP (x, 0);
+		  /* We use the original pseudo for loc, so that
+		     emit_reload_insns() knows which pseudo this
+		     reload refers to and updates the pseudo rtx, not
+		     its equivalent memory location, as well as the
+		     corresponding entry in reg_last_reload_reg.  */
+		  loc = &XEXP (x_orig, 0);
 		  x = XEXP (x, 0);
 		    = push_reload (x, x, loc, loc,
 				   (context ? INDEX_REG_CLASS : BASE_REG_CLASS),
 				   GET_MODE (x), GET_MODE (x), 0, 0,
 				   opnum, RELOAD_OTHER);
-		  /* If we created a new MEM based on reg_equiv_mem[REGNO], then
-		     LOC above is part of the new MEM, not the MEM in INSN.
-		     We must also replace the address of the MEM in INSN.  */
-		  if (&XEXP (x_orig, 0) != loc)
-		    push_replacement (&XEXP (x_orig, 0), reloadnum, VOIDmode);

Alexandre Oliva   Enjoy Guarana', see
Red Hat GCC Developer                  aoliva@{,}
CS PhD student at IC-Unicamp        oliva@{,}
Free Software Evangelist    *Please* write to mailing lists, not to me

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