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]

try_to_split tweek to allow splitters create labels


Hi
The try_split believe that all new jumps created by splitting jump_insn are
pointing to the same label.
I need to split jumps into jump-around-jump sequence so I need to update
the labels properly.
I do it by sharing code from jump.c

St srp  9 22:10:30 CEST 2000  Jan Hubicka  <jh@suse.cz>

	* emit-rtl.c (try_split): Fix code to mark labels.
	* jump.c (mark_jump_label): Make global.
	* rtl.h (mark_jump_label): Declare.

*** emit-rtl.c.old	Wed Aug  9 18:44:36 2000
--- emit-rtl.c	Wed Aug  9 18:48:52 2000
*************** try_split (pat, trial, last)
*** 2419,2437 ****
  		&& rtx_equal_p (PATTERN (XVECEXP (seq, 0, i)), pat))
    	      return trial;
  
! 	  /* If we are splitting a JUMP_INSN, look for the JUMP_INSN in
! 	     SEQ and copy our JUMP_LABEL to it.  If JUMP_LABEL is non-zero,
! 	     increment the usage count so we don't delete the label.  */
! 
! 	  if (GET_CODE (trial) == JUMP_INSN)
! 	    for (i = XVECLEN (seq, 0) - 1; i >= 0; i--)
! 	      if (GET_CODE (XVECEXP (seq, 0, i)) == JUMP_INSN)
! 		{
! 		  JUMP_LABEL (XVECEXP (seq, 0, i)) = JUMP_LABEL (trial);
! 
! 		  if (JUMP_LABEL (trial))
! 		    LABEL_NUSES (JUMP_LABEL (trial))++;
! 		}
  
  	  /* If we are splitting a CALL_INSN, look for the CALL_INSN
  	     in SEQ and copy our CALL_INSN_FUNCTION_USAGE to it.  */
--- 2419,2429 ----
  		&& rtx_equal_p (PATTERN (XVECEXP (seq, 0, i)), pat))
    	      return trial;
  
! 	  /* Mark labels.  */
! 	  for (i = XVECLEN (seq, 0) - 1; i >= 0; i--)
! 	    if (GET_CODE (XVECEXP (seq, 0, i)) == JUMP_INSN)
! 	      mark_jump_label (PATTERN (XVECEXP (seq, 0, i)),
! 			       XVECEXP (seq, 0, i), 0, 0);
  
  	  /* If we are splitting a CALL_INSN, look for the CALL_INSN
  	     in SEQ and copy our CALL_INSN_FUNCTION_USAGE to it.  */
*** jump.c.old	Wed Aug  9 18:44:00 2000
--- jump.c	Wed Aug  9 19:37:49 2000
*************** static void find_cross_jump		PARAMS ((rt
*** 113,119 ****
  static void do_cross_jump		PARAMS ((rtx, rtx, rtx));
  static int jump_back_p			PARAMS ((rtx, rtx));
  static int tension_vector_labels	PARAMS ((rtx, int));
- static void mark_jump_label		PARAMS ((rtx, rtx, int, int));
  static void delete_computation		PARAMS ((rtx));
  static void redirect_exp_1		PARAMS ((rtx *, rtx, rtx, rtx));
  static int redirect_exp			PARAMS ((rtx, rtx, rtx));
--- 113,118 ----
*************** tension_vector_labels (x, idx)
*** 2370,2376 ****
     Once reload has completed (CROSS_JUMP non-zero), we need not consider
     two labels distinct if they are separated by only USE or CLOBBER insns.  */
  
! static void
  mark_jump_label (x, insn, cross_jump, in_mem)
       register rtx x;
       rtx insn;
--- 2369,2375 ----
     Once reload has completed (CROSS_JUMP non-zero), we need not consider
     two labels distinct if they are separated by only USE or CLOBBER insns.  */
  
! void
  mark_jump_label (x, insn, cross_jump, in_mem)
       register rtx x;
       rtx insn;
*** rtl.h.old	Wed Aug  9 18:43:51 2000
--- rtl.h	Wed Aug  9 18:43:55 2000
*************** extern enum rtx_code reverse_condition_m
*** 1279,1284 ****
--- 1279,1285 ----
  extern enum rtx_code swap_condition	PARAMS ((enum rtx_code));
  extern enum rtx_code unsigned_condition	PARAMS ((enum rtx_code));
  extern enum rtx_code signed_condition	PARAMS ((enum rtx_code));
+ extern void mark_jump_label		PARAMS ((rtx, rtx, int, int));
  
  /* In reload.c */
  extern rtx find_equiv_reg		PARAMS ((rtx, rtx, enum reg_class, int, short *, int, enum machine_mode));

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