This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: testcase for enable-checking failure flow_delete_insn
- From: Richard Henderson <rth at redhat dot com>
- To: Graham Stott <grahams at redhat dot com>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Mon, 31 Dec 2001 01:02:45 -0800
- Subject: Re: testcase for enable-checking failure flow_delete_insn
- References: <3B6ECDEC.40B3C941@redhat.com> <3C2FF9A1.6F6F8FEF@redhat.com>
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;