Loop fix from Meissner

Jeffrey A Law law@cygnus.com
Sat Feb 6 00:48:00 GMT 1999


This avoids an out of range access in the INSN_LUID macro exposed by PPC
and PA testing.

        * loop.c (check_dbra_loop): A store using an address giv for which
        we have no life information is not reversible.

Index: loop.c
===================================================================
RCS file: /egcs/carton/cvsfiles/egcs/gcc/loop.c,v
retrieving revision 1.130
diff -c -3 -p -r1.130 loop.c
*** loop.c	1999/02/05 14:38:32	1.130
--- loop.c	1999/02/06 07:33:26
*************** check_dbra_loop (loop_end, insn_count, l
*** 7713,7720 ****
  		  if (v->giv_type == DEST_REG
  		      && reg_mentioned_p (v->dest_reg,
  					  XEXP (loop_store_mems, 0))
! 		      && (INSN_LUID (v->insn)
! 			  > INSN_LUID (first_loop_store_insn)))
  		    reversible_mem_store = 0;
  		}
  	    }
--- 7713,7721 ----
  		  if (v->giv_type == DEST_REG
  		      && reg_mentioned_p (v->dest_reg,
  					  XEXP (loop_store_mems, 0))
! 		      && (INSN_UID (v->insn) >= max_uid_for_loop
! 			  || (INSN_LUID (v->insn)
! 			      > INSN_LUID (first_loop_store_insn))))
  		    reversible_mem_store = 0;
  		}
  	    }


More information about the Gcc-patches mailing list