This is the mail archive of the gcc@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]

Re: The current egcs is broken on x86


This is a bug in Meissner's regmove.c change.  Here is a workaround patch.

Mike, can you please look at this and work up a better patch?

1998-06-12  Jim Wilson  <wilson@cygnus.com>

	* regmove.c (copy_src_to_dest): Only perform optimization if DEST and
	SRC both have positive REG_LIVE_LENGTH values.

Index: regmove.c
===================================================================
RCS file: /egcs/carton/cvsfiles/egcs/gcc/regmove.c,v
retrieving revision 1.20
diff -p -r1.20 regmove.c
*** regmove.c	1998/06/11 11:51:51	1.20
--- regmove.c	1998/06/12 21:43:59
*************** copy_src_to_dest (insn, src, dest, loop_
*** 555,564 ****
    int insn_uid;
    int move_uid;
  
    if (GET_CODE (src) == REG && GET_CODE (dest) == REG
        && (set = single_set (insn)) != NULL_RTX
        && !reg_mentioned_p (dest, SET_SRC (set))
!       && validate_replace_rtx (src, dest, insn))
      {
        /* Generate the src->dest move.  */
        start_sequence ();
--- 555,571 ----
    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
        && (set = single_set (insn)) != NULL_RTX
        && !reg_mentioned_p (dest, SET_SRC (set))
!       && validate_replace_rtx (src, dest, insn)
!       && REG_LIVE_LENGTH (REGNO (dest)) >= 0
!       && REG_LIVE_LENGTH (REGNO (src)) >= 0)
      {
        /* Generate the src->dest move.  */
        start_sequence ();


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