try_split fix

Richard Henderson rth@cygnus.com
Thu Jan 21 21:57:00 GMT 1999


A split should be able to expand to a sequence of code with embedded
branches.  This fixes an assumption to the contrary wrt code labels.


r~


        * emit-rtl.c (try_split): Don't try to split non-instructions.

Index: emit-rtl.c
===================================================================
RCS file: /cvs/cvsfiles/devo/gcc/emit-rtl.c,v
retrieving revision 1.123
diff -c -p -d -r1.123 emit-rtl.c
*** emit-rtl.c	1999/01/21 19:46:39	1.123
--- emit-rtl.c	1999/01/22 05:52:40
*************** try_split (pat, trial, last)
*** 2271,2282 ****
  	     time control returns here that insn will be fully split, so
  	     set LAST and continue from the insn after the one returned.
  	     We can't use next_active_insn here since AFTER may be a note.
! 	     Ignore deleted insns, which can be occur if not optimizing,
! 	     and ignore BARRIERs which can occur if we split the insn
! 	     immediately before a BARRIER.  */
  	  for (tem = NEXT_INSN (before); tem != after;
  	       tem = NEXT_INSN (tem))
! 	    if (! INSN_DELETED_P (tem) && GET_CODE (tem) != BARRIER)
  	      tem = try_split (PATTERN (tem), tem, 1);
  	}
        /* Avoid infinite loop if the result matches the original pattern.  */
--- 2271,2281 ----
  	     time control returns here that insn will be fully split, so
  	     set LAST and continue from the insn after the one returned.
  	     We can't use next_active_insn here since AFTER may be a note.
! 	     Ignore deleted insns, which can be occur if not optimizing.  */
  	  for (tem = NEXT_INSN (before); tem != after;
  	       tem = NEXT_INSN (tem))
! 	    if (! INSN_DELETED_P (tem)
! 		&& GET_RTX_CLASS (GET_CODE (tem)) == 'i')
  	      tem = try_split (PATTERN (tem), tem, 1);
  	}
        /* Avoid infinite loop if the result matches the original pattern.  */



More information about the Gcc-patches mailing list