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]
Other format: [Raw text]

[reload-branch]: Don't set inc field for non-autoinc reloads


This should fix the problem Ulrich Weigand reported (we test INC to see if we have an autoinc reload, but it can be nonzero even if we don't). Committed.


Bernd
	* reload.c (find_reloads): Only set INC field if we know we have an
	autoinc reload.
	* reload.h (struct reload): Update comment to match.

Index: reload.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/reload.c,v
retrieving revision 1.268.6.2
diff -c -p -r1.268.6.2 reload.c
*** reload.c	7 Apr 2005 11:21:35 -0000	1.268.6.2
--- reload.c	12 Apr 2005 09:08:49 -0000
*************** find_reloads (struct insn_chain *chain, 
*** 3203,3216 ****
  		 && goal_alternative_offmemok[i]
  		 && MEM_P (recog_data.operand[i]))
  	  {
  	    operand_reloadnum[i]
  	      = push_reload (XEXP (recog_data.operand[i], 0), NULL_RTX,
  			     &XEXP (recog_data.operand[i], 0), (rtx*) 0,
  			     MODE_BASE_REG_CLASS (VOIDmode),
  			     GET_MODE (XEXP (recog_data.operand[i], 0)),
  			     VOIDmode, 0, 0, i, RELOAD_FOR_NONE);
! 	    rld[operand_reloadnum[i]].inc
! 	      = GET_MODE_SIZE (GET_MODE (recog_data.operand[i]));
  	  }
  	else if (goal_alternative_matched[i] == -1)
  	  {
--- 3203,3221 ----
  		 && goal_alternative_offmemok[i]
  		 && MEM_P (recog_data.operand[i]))
  	  {
+ 	    struct reload *rl;
  	    operand_reloadnum[i]
  	      = push_reload (XEXP (recog_data.operand[i], 0), NULL_RTX,
  			     &XEXP (recog_data.operand[i], 0), (rtx*) 0,
  			     MODE_BASE_REG_CLASS (VOIDmode),
  			     GET_MODE (XEXP (recog_data.operand[i], 0)),
  			     VOIDmode, 0, 0, i, RELOAD_FOR_NONE);
! 	    rl = rld + operand_reloadnum[i];
! 	    if (GET_CODE (rl->in_reg) == PRE_INC
! 		|| GET_CODE (rl->in_reg) == PRE_DEC
! 		|| GET_CODE (rl->in_reg) == POST_INC
! 		|| GET_CODE (rl->in_reg) == POST_DEC)
! 	      rl->inc = GET_MODE_SIZE (GET_MODE (recog_data.operand[i]));
  	  }
  	else if (goal_alternative_matched[i] == -1)
  	  {
Index: reload.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/reload.h,v
retrieving revision 1.50.14.2
diff -c -p -r1.50.14.2 reload.h
*** reload.h	7 Apr 2005 11:21:35 -0000	1.50.14.2
--- reload.h	12 Apr 2005 09:08:49 -0000
*************** struct reload
*** 188,194 ****
  
    /* Positive amount to increment or decrement by if
       reload_in is a PRE_DEC, PRE_INC, POST_DEC, POST_INC.
!      Ignored otherwise (don't assume it is zero).  */
    int inc;
    /* A reg for which reload_in is the equivalent.
       If reload_in is a symbol_ref which came from
--- 188,194 ----
  
    /* Positive amount to increment or decrement by if
       reload_in is a PRE_DEC, PRE_INC, POST_DEC, POST_INC.
!      Otherwise zero.  */
    int inc;
    /* A reg for which reload_in is the equivalent.
       If reload_in is a symbol_ref which came from

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