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]

[patch] stormy16 -- REG_INC notes required for split moves


stormy16_split_move failed to preserve the REG_INC notes for moves
that contained auto increments.  These notes were being lost which
resulted in the incorrect deletion of instructions.  OK to install?

Catherine

2001-10-14  Catherine Moore  <clm@redhat.com>

	* config/stormy16/stormy16.c (stormy16_split_move):  Make
	sure that REG_INC notes are present for auto_inc operands.

Index: stormy16.c
===================================================================
RCS file: /cvs/gcc/egcs/gcc/config/stormy16/stormy16.c,v
retrieving revision 1.4
diff -p -r1.4 stormy16.c
*** stormy16.c	2001/09/21 01:27:06	1.4
--- stormy16.c	2001/10/15 01:05:53
*************** stormy16_split_move (mode, dest, src)
*** 641,646 ****
--- 641,647 ----
    int src_volatile = 0;
    int dest_volatile = 0;
    rtx mem_operand;
+   rtx auto_inc_reg_rtx = NULL_RTX;
    
    /* Check initial conditions.  */
    if (! reload_completed
*************** stormy16_split_move (mode, dest, src)
*** 673,678 ****
--- 674,681 ----
      {
        mem_operand = XEXP (dest, 0);
        dest_modifies = side_effects_p (mem_operand);
+       if (auto_inc_p (mem_operand))
+         auto_inc_reg_rtx = XEXP (mem_operand, 0);
        dest_volatile = MEM_VOLATILE_P (dest);
        if (dest_volatile)
  	{
*************** stormy16_split_move (mode, dest, src)
*** 684,689 ****
--- 687,694 ----
      {
        mem_operand = XEXP (src, 0);
        src_modifies = side_effects_p (mem_operand);
+       if (auto_inc_p (mem_operand))
+         auto_inc_reg_rtx = XEXP (mem_operand, 0);
        src_volatile = MEM_VOLATILE_P (src);
        if (src_volatile)
  	{
*************** stormy16_split_move (mode, dest, src)
*** 733,739 ****
    end = direction < 0 ? -1 : num_words;
    for (i = direction < 0 ? num_words - 1 : 0; i != end; i += direction)
      {
!       rtx w_src, w_dest;
        if (src_modifies)
  	w_src = gen_rtx_MEM (word_mode, mem_operand);
        else
--- 738,745 ----
    end = direction < 0 ? -1 : num_words;
    for (i = direction < 0 ? num_words - 1 : 0; i != end; i += direction)
      {
!       rtx w_src, w_dest, insn;
! 
        if (src_modifies)
  	w_src = gen_rtx_MEM (word_mode, mem_operand);
        else
*************** stormy16_split_move (mode, dest, src)
*** 753,759 ****
  	  || GET_CODE (w_dest) == SUBREG)
  	abort ();
        
!       emit_insn (gen_rtx_SET (VOIDmode, w_dest, w_src));
      }
  }
  
--- 759,769 ----
  	  || GET_CODE (w_dest) == SUBREG)
  	abort ();
        
!       insn = emit_insn (gen_rtx_SET (VOIDmode, w_dest, w_src));
!       if (auto_inc_reg_rtx)
!         REG_NOTES (insn) = alloc_EXPR_LIST (REG_INC,
!                                             auto_inc_reg_rtx,
! 					      REG_NOTES (insn));
      }
  }
  


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