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]
Other format: [Raw text]

Re: testcase for enable-checking failure flow_delete_insn


On Mon, Dec 31, 2001 at 05:37:37AM +0000, Graham Stott wrote:
> > Attached is a testcase which triggers the enabled checking failure
> > in flow_delete_insn it took me a long time to find it because I
> > forgot the abort occurred compiling GDB and not GCC
> > 
> > Compile x86 -O2
> > 
> > The problem occurs because we change the CODE_LABEL into a
> > NOTE_INSN_DELETED_LABEL in this bit of code in flow_delete_insn_chain
> > 
> >      else if (GET_CODE (insn) == CODE_LABEL
> >                && ! can_delete_label_p (insn))
> >         {
> >           const char *name = LABEL_NAME (insn);
> >           PUT_CODE (insn, NOTE);
> >           NOTE_LINE_NUMBER (insn) = NOTE_INSN_DELETED_LABEL;
> >           NOTE_SOURCE_FILE (insn) = name;
> >         }
> > 
> > We then later decide to correctly delete the jump_table which triggers
> > the abort.

Sounds about right.  I'm testing the following.


r~



Index: cfgrtl.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/cfgrtl.c,v
retrieving revision 1.23
diff -c -p -d -r1.23 cfgrtl.c
*** cfgrtl.c	2001/12/30 12:20:42	1.23
--- cfgrtl.c	2001/12/31 09:01:32
*************** delete_insn (insn)
*** 161,167 ****
        int i;
  
        for (i = 0; i < len; i++)
! 	LABEL_NUSES (XEXP (XVECEXP (pat, diff_vec_p, i), 0))--;
      }
  
    return next;
--- 161,175 ----
        int i;
  
        for (i = 0; i < len; i++)
! 	{
! 	  rtx label = XEXP (XVECEXP (pat, diff_vec_p, i), 0);
! 
! 	  /* When deleting code in bulk (e.g. removing many unreachable
! 	     blocks) we can delete a label that's a target of the vector
! 	     before deleting the vector itself.  */
! 	  if (GET_CODE (label) != NOTE)
! 	    LABEL_NUSES (label)--;
! 	}
      }
  
    return next;


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