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]

A patch for regmove.c


> 
> My patched rebuild failed in stage2 while running the stage2 compiler to
> build the SYSCALLS.c file.  I suspect another bug in the recent regmove
> changes.
> 
> Jim
> 

Hi, Jim,

How about this patch? It seems to work for me. We have to check
REG_LIVE_LENGTH before validate_replace_rtx. Otherwise, it may be
too late.


-- 
H.J. Lu (hjl@gnu.org)
---
Index: regmove.c
===================================================================
RCS file: /home/work/cvs/gnu/egcs/gcc/regmove.c,v
retrieving revision 1.1.1.18
diff -u -r1.1.1.18 regmove.c
--- regmove.c	1998/06/12 15:07:14	1.1.1.18
+++ regmove.c	1998/06/13 17:19:03
@@ -555,7 +555,14 @@
   int insn_uid;
   int move_uid;
 
+  /* ??? A REG_LIVE_LENGTH of -1 or -2 is special.  It is wrong to increment
+     them, particular since this may result in a value of zero which is
+     invalid.  We obviously need some special handling of these case.  For now,
+     we just reject them.  */
+
   if (GET_CODE (src) == REG && GET_CODE (dest) == REG
+      && REG_LIVE_LENGTH (REGNO (dest)) >= 0
+      && REG_LIVE_LENGTH (REGNO (src)) >= 0
       && (set = single_set (insn)) != NULL_RTX
       && !reg_mentioned_p (dest, SET_SRC (set))
       && validate_replace_rtx (src, dest, insn))




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