This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
flow.c bugfix
- To: gcc-patches at gcc dot gnu dot org
- Subject: flow.c bugfix
- From: Jeffrey A Law <law at cygnus dot com>
- Date: Thu, 03 Aug 2000 01:18:11 -0600
- Reply-To: law at cygnus dot com
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)
{