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]

reg-stack fix


Hi
The reg-stack is creating improper insns like:
(plus:DF (float_extend:DF (reg:DF))
	 (reg:SF))
by swapping the registers.  This patch fixes this by swapping the regnos only.
This isn't particulary clean, since it makes since register to be accessed
as SF and then DF, but resulting insn chain is correct and similar cases
happends after eliminating of SUBREGs too, so I don't think someone
post-reload should complain about it.

Honza

Thu Aug  3 16:10:37 MET DST 2000  Jan Hubicka  <jh@suse.cz>
	* reg-stack.c (subst_stack_regs_pat):  Use replace_reg to swap
	operands.
*** reg-stack.c.old	Mon Jul 10 15:51:42 2000
--- reg-stack.c	Thu Aug  3 10:51:06 2000
*************** subst_stack_regs_pat (insn, regstack, pa
*** 1638,1646 ****
  		&& REG_P (*src1) && REG_P (*src2)
  		&& REGNO (*src1) != REGNO (*dest))
  	     {
! 		rtx tmp = *src1;
! 		*src1 = *src2;
! 		*src2 = tmp;
  	     }
  	    break;
  
--- 1638,1646 ----
  		&& REG_P (*src1) && REG_P (*src2)
  		&& REGNO (*src1) != REGNO (*dest))
  	     {
! 		int tmp = REGNO (*src1);
! 		replace_reg (src1, REGNO (*src2));
! 		replace_reg (src2, tmp);
  	     }
  	    break;
  

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