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

Re: ARM 2878


OK, I've had a few minutes to take a quick look at this, and I think the
following will fix it.  But I don't have time to test it any further, or to
install the change this week.

Phil, could you give this a whirl and then if Mark is happy install the patch.

Richard.

<date>  Richard Earnshaw (reanrsha@arm.com)

	* arm.c (arm_reload_in_hi): Handle the scratch operand overlapping
	with the output operand.


Index: arm.c
===================================================================
RCS file: /cvs/gcc/egcs/gcc/config/arm/arm.c,v
retrieving revision 1.142.2.2
diff -p -p -r1.142.2.2 arm.c
*** arm.c	2001/05/24 21:11:38	1.142.2.2
--- arm.c	2001/06/11 23:04:18
*************** arm_reload_in_hi (operands)
*** 4821,4828 ****
  	  offset = lo;
  	}
      }
  
-   scratch = gen_rtx_REG (SImode, REGNO (operands[2]));
    emit_insn (gen_zero_extendqisi2 (scratch,
  				   gen_rtx_MEM (QImode,
  						plus_constant (base,
--- 4809,4822 ----
  	  offset = lo;
  	}
      }
+ 
+   /* If the scratch overlaps the output, use the top half of the DImode
+      register we allocated.  */
+   if (REGNO (operands[2]) == REGNO (operands[0]))
+     scratch = gen_rtx_REG (SImode, REGNO (operands[2]) + 1);
+   else
+     scratch = gen_rtx_REG (SImode, REGNO (operands[2]));
  
    emit_insn (gen_zero_extendqisi2 (scratch,
  				   gen_rtx_MEM (QImode,
  						plus_constant (base,

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