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]

Fix gcc.c-torture/compile/20000105-1.c -O0


We used to not delete the addr_vec for a switch in 
a block that went away entirely.  This caused one of
global's sanity checks to fail.

Boostrapped alphaev56-dec-linux-gnu.


r~


        * flow.c (delete_block): Delete the addr_vec along with the block.
        (flow_delete_insn): Decrement LABEL_NUSES when deleting insns that
        reference labels.

Index: flow.c
===================================================================
RCS file: /cvs/gcc/egcs/gcc/flow.c,v
retrieving revision 1.238
diff -c -p -d -r1.238 flow.c
*** flow.c	2000/03/18 19:08:06	1.238
--- flow.c	2000/03/19 11:26:39
*************** delete_block (b)
*** 1853,1859 ****
       basic_block b;
  {
    int deleted_handler = 0;
!   rtx insn, end;
  
    /* If the head of this block is a CODE_LABEL, then it might be the
       label for an exception handler which can't be reached.
--- 1853,1859 ----
       basic_block b;
  {
    int deleted_handler = 0;
!   rtx insn, end, tmp;
  
    /* If the head of this block is a CODE_LABEL, then it might be the
       label for an exception handler which can't be reached.
*************** delete_block (b)
*** 1902,1912 ****
  	}
      }
  
!   /* Selectively unlink the insn chain.  Include any BARRIER that may
!      follow the basic block.  */
!   end = next_nonnote_insn (b->end);
!   if (!end || GET_CODE (end) != BARRIER)
!     end = b->end;
    flow_delete_insn_chain (insn, end);
  
   no_delete_insns:
--- 1902,1923 ----
  	}
      }
  
!   /* Include any jump table following the basic block.  */
!   end = b->end;
!   if (GET_CODE (end) == JUMP_INSN
!       && (tmp = JUMP_LABEL (end)) != NULL_RTX
!       && (tmp = NEXT_INSN (tmp)) != NULL_RTX
!       && GET_CODE (tmp) == JUMP_INSN
!       && (GET_CODE (PATTERN (tmp)) == ADDR_VEC
! 	  || GET_CODE (PATTERN (tmp)) == ADDR_DIFF_VEC))
!     end = tmp;
! 
!   /* Include any barrier that may follow the basic block.  */
!   tmp = next_nonnote_insn (b->end);
!   if (tmp && GET_CODE (tmp) == BARRIER)
!     end = tmp;
! 
!   /* Selectively delete the entire chain.  */
    flow_delete_insn_chain (insn, end);
  
   no_delete_insns:
*************** flow_delete_insn (insn)
*** 1972,1977 ****
--- 1983,1989 ----
  {
    rtx prev = PREV_INSN (insn);
    rtx next = NEXT_INSN (insn);
+   rtx note;
  
    PREV_INSN (insn) = NULL_RTX;
    NEXT_INSN (insn) = NULL_RTX;
*************** flow_delete_insn (insn)
*** 1990,1995 ****
--- 2002,2011 ----
       the label itself should happen in the normal course of block merging.  */
    if (GET_CODE (insn) == JUMP_INSN && JUMP_LABEL (insn))
      LABEL_NUSES (JUMP_LABEL (insn))--;
+ 
+   /* Also if deleting an insn that references a label.  */
+   else if ((note = find_reg_note (insn, REG_LABEL, NULL_RTX)) != NULL_RTX)
+     LABEL_NUSES (XEXP (note, 0))--;
  
    return next;
  }

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