Fix unroll.c/JUMP_LABEL

Jan Hubicka jh@suse.cz
Sun Jan 6 11:35:00 GMT 2002


Hi,
when copying insn unroll forgets to update JUMP_LABEL and LABEL_NUSES.  I hope
this patch to solve the SPEC2000 regression from Dec02 where unroll.c has been
made strickier about NULL JUMP_LABELs, but it looks like proper fix anyway.

I've regtested it i386. Didn't bootstrapped it as it affects only unroll-loops
code not excercised by normal bootstrap and -funroll-all-loops dies for me
independently on the patch - I am looking at the issue now.


Sun Jan  6 20:31:56 CET 2002  Jan Hubicka  <jh@suse.cz>
	* unroll.c (copy_loop_body): Always properly update JUMP_LABEL and
	LABEL_NUSES.

Index: unroll.c
===================================================================
RCS file: /cvs/gcc/egcs/gcc/unroll.c,v
retrieving revision 1.144.2.4
diff -c -3 -p -r1.144.2.4 unroll.c
*** unroll.c	2001/12/29 16:54:00	1.144.2.4
--- unroll.c	2002/01/06 19:31:43
*************** copy_loop_body (loop, copy_start, copy_e
*** 2073,2086 ****
  	  copy = emit_jump_insn (pattern);
  	  REG_NOTES (copy) = initial_reg_note_copy (REG_NOTES (insn), map);
  
! 	  if (JUMP_LABEL (insn) == start_label && insn == copy_end
! 	      && ! last_iteration)
  	    {
- 	      /* Update JUMP_LABEL make invert_jump work correctly.  */
  	      JUMP_LABEL (copy) = get_label_from_map (map,
  						      CODE_LABEL_NUMBER
  						      (JUMP_LABEL (insn)));
  	      LABEL_NUSES (JUMP_LABEL (copy))++;
  
  	      /* This is a branch to the beginning of the loop; this is the
  		 last insn being copied; and this is not the last iteration.
--- 2073,2088 ----
  	  copy = emit_jump_insn (pattern);
  	  REG_NOTES (copy) = initial_reg_note_copy (REG_NOTES (insn), map);
  
! 	  if (JUMP_LABEL (insn))
  	    {
  	      JUMP_LABEL (copy) = get_label_from_map (map,
  						      CODE_LABEL_NUMBER
  						      (JUMP_LABEL (insn)));
  	      LABEL_NUSES (JUMP_LABEL (copy))++;
+ 	    }
+ 	  if (JUMP_LABEL (insn) == start_label && insn == copy_end
+ 	      && ! last_iteration)
+ 	    {
  
  	      /* This is a branch to the beginning of the loop; this is the
  		 last insn being copied; and this is not the last iteration.



More information about the Gcc-patches mailing list