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]

flow.c bugfix




This is an update to Herman's flow.c bugfix which verifies that we've got
a register before trying to look at the register #.

	* flow.c (find_auto_inc): Verify that we've got a REG before
	peeking at its regno.  Fail, don't abort if we can't find
	the increment of the desired register.

Index: flow.c
===================================================================
RCS file: /cvs/gcc/egcs/gcc/flow.c,v
retrieving revision 1.316
diff -c -3 -p -r1.316 flow.c
*** flow.c	2000/08/02 04:21:26	1.316
--- flow.c	2000/08/03 07:14:23
*************** find_auto_inc (pbi, x, insn)
*** 5018,5029 ****
    if (GET_CODE (y) != PLUS)
      return;
  
!   if (REGNO (XEXP (y, 0)) == REGNO (addr))
      inc_val = XEXP (y, 1);
!   else if (REGNO (XEXP (y, 1)) == REGNO (addr))
      inc_val = XEXP (y, 0);
    else
!     abort ();
  
    if (GET_CODE (inc_val) == CONST_INT)
      {
--- 5018,5029 ----
    if (GET_CODE (y) != PLUS)
      return;
  
!   if (REG_P (XEXP (y, 0)) && REGNO (XEXP (y, 0)) == REGNO (addr))
      inc_val = XEXP (y, 1);
!   else if (REG_P (XEXP (y, 1)) && REGNO (XEXP (y, 1)) == REGNO (addr))
      inc_val = XEXP (y, 0);
    else
!     return;
  
    if (GET_CODE (inc_val) == CONST_INT)
      {





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