bug fix for load_mems:

Joern Rennecke amylaar@cygnus.co.uk
Wed Feb 10 11:20:00 GMT 1999


With a different set of REG_EQUAL notes available, I found that load_mems
was creating invalid instructions for the SH4.
Here is a fix:

Wed Feb 10 19:16:13 1999  J"orn Rennecke <amylaar@cygnus.co.uk>

	* loop.c (load_mems): Don't guess how to do a load / store, use
	emit_move_insn.

Index: loop.c
===================================================================
RCS file: /cvs/cvsfiles/devo/gcc/loop.c,v
retrieving revision 1.166.2.21
diff -p -r1.166.2.21 loop.c
*** loop.c	1999/02/08 15:12:24	1.166.2.21
--- loop.c	1999/02/10 19:15:32
*************** load_mems (scan_start, end, loop_top, st
*** 9489,9495 ****
  
  	      /* Load the memory immediately before START, which is
  		 the NOTE_LOOP_BEG.  */
! 	      set = gen_rtx_SET (GET_MODE (reg), reg, mem);
  	      emit_insn_before (set, start);
  
  	      if (written)
--- 9449,9455 ----
  
  	      /* Load the memory immediately before START, which is
  		 the NOTE_LOOP_BEG.  */
! 	      set = gen_move_insn (reg, mem);
  	      emit_insn_before (set, start);
  
  	      if (written)
*************** load_mems (scan_start, end, loop_top, st
*** 9506,9512 ****
  
  		  /* Store the memory immediately after END, which is
  		   the NOTE_LOOP_END.  */
! 		  set = gen_rtx_SET (GET_MODE (reg), copy_rtx (mem), reg); 
  		  emit_insn_after (set, label);
  		}
  
--- 9466,9472 ----
  
  		  /* Store the memory immediately after END, which is
  		   the NOTE_LOOP_END.  */
! 		  set = gen_move_insn (copy_rtx (mem), reg); 
  		  emit_insn_after (set, label);
  		}
  


More information about the Gcc-patches mailing list