Abort in redirect_edge_and_branch on vax at line 866

Jan Hubicka jh@suse.cz
Wed Jan 9 02:25:00 GMT 2002


> Is the problem that the edge wasn't updated when the label was removed
> from insn 496?  Or, can we just ignore old_label when there is no
> JUMP_LABEL in the insn.  Or, should the gcse pass have completely
> removed bb 21?
Checking the real code I found that gcse is currently able to force
existence of noop jump but just keeps the isnsn in the chain for no
purpose (probably because originally it has been dificult to remove
last insn in the BB).

The attached patch should do the trick for you.
Bootstrapped/regtested i386. OK to install?

Wed Jan  9 11:23:03 CET 2002  Jan Hubicka  <jh@suse.cz>
	* gcse.c (cprop_jump): Delete insn if simplified jump is no-op.
Index: gcse.c
===================================================================
RCS file: /cvs/gcc/egcs/gcc/gcse.c,v
retrieving revision 1.173
diff -c -3 -p -r1.173 gcse.c
*** gcse.c	2002/01/08 16:51:38	1.173
--- gcse.c	2002/01/09 10:22:47
*************** cprop_jump (bb, insn, from, src)
*** 4040,4064 ****
    /* If this is now a no-op leave it that way, but update LABEL_NUSED if
       necessary.  */
    if (new == pc_rtx)
!     {
!       SET_SRC (set) = new;
! 
!       if (JUMP_LABEL (insn) != 0)
! 	{
! 	  --LABEL_NUSES (JUMP_LABEL (insn));
! 	  JUMP_LABEL (insn) = NULL_RTX;
! 	}
!     }
! 
    /* Otherwise, this must be a valid instruction.  */
!   else if (! validate_change (insn, &SET_SRC (set), new, 0))
!     return 0;
  
!   /* If this has turned into an unconditional jump,
!      then put a barrier after it so that the unreachable
!      code will be deleted.  */
!   if (GET_CODE (SET_SRC (set)) == LABEL_REF)
!     emit_barrier_after (insn);
  
    run_jump_opt_after_gcse = 1;
  
--- 4040,4058 ----
    /* If this is now a no-op leave it that way, but update LABEL_NUSED if
       necessary.  */
    if (new == pc_rtx)
!     delete_insn (insn);
    /* Otherwise, this must be a valid instruction.  */
!   else
!     {
!       if (! validate_change (insn, &SET_SRC (set), new, 0))
! 	return 0;
  
!       /* If this has turned into an unconditional jump,
! 	 then put a barrier after it so that the unreachable
! 	 code will be deleted.  */
!       if (GET_CODE (SET_SRC (set)) == LABEL_REF)
! 	emit_barrier_after (insn);
!      }
  
    run_jump_opt_after_gcse = 1;
  



More information about the Gcc-bugs mailing list