diff options
author | Jeffrey A Law <law@cygnus.com> | 2001-05-16 04:12:33 +0000 |
---|---|---|
committer | Jeff Law <law@gcc.gnu.org> | 2001-05-15 22:12:33 -0600 |
commit | fca790eb60478652025f6604d5b57152cb5160c9 (patch) | |
tree | 6d5d814185393b802dbdb1574b39b2a7cb13e15e /gcc | |
parent | 48941cb809ff5c9be1116cb9669872017568c670 (diff) | |
download | gcc-fca790eb60478652025f6604d5b57152cb5160c9.zip gcc-fca790eb60478652025f6604d5b57152cb5160c9.tar.gz gcc-fca790eb60478652025f6604d5b57152cb5160c9.tar.bz2 |
flow.c (life_analysis): After life analysis is complete...
* flow.c (life_analysis): After life analysis is complete, do
an optional scan over insns looking for REG_LABEL notes that
reference a deleted label.
(propagate_block_delete_insn): Verify INOTE is a CODE_LABEL
before peeking at LABEL_NUSES.
From-SVN: r42131
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ChangeLog | 8 | ||||
-rw-r--r-- | gcc/flow.c | 28 |
2 files changed, 34 insertions, 2 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index b624dbf..d0f8dfe 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,11 @@ +Tue May 15 22:14:09 2001 Jeffrey A Law (law@cygnus.com) + + * flow.c (life_analysis): After life analysis is complete, do + an optional scan over insns looking for REG_LABEL notes that + reference a deleted label. + (propagate_block_delete_insn): Verify INOTE is a CODE_LABEL + before peeking at LABEL_NUSES. + 2001-05-15 Richard Henderson <rth@redhat.com> * unwind-sjlj.c (_Unwind_GetDataRelBase): New. @@ -2854,6 +2854,21 @@ life_analysis (f, file, flags) dump_flow_info (file); free_basic_block_vars (1); + +#ifdef ENABLE_CHECKING + { + rtx insn; + + /* Search for any REG_LABEL notes whih reference deleted labels. */ + for (insn = get_insns (); insn; insn = NEXT_INSN (insn)) + { + rtx inote = find_reg_note (insn, REG_LABEL, NULL_RTX); + + if (inote && GET_CODE (inote) == NOTE_INSN_DELETED_LABEL) + abort (); + } + } +#endif } /* A subroutine of verify_wide_reg, called through for_each_rtx. @@ -3631,9 +3646,18 @@ propagate_block_delete_insn (bb, insn) /* If the insn referred to a label, and that label was attached to an ADDR_VEC, it's safe to delete the ADDR_VEC. In fact, it's pretty much mandatory to delete it, because the ADDR_VEC may be - referencing labels that no longer exist. */ + referencing labels that no longer exist. + + INSN may reference a deleted label, particularly when a jump + table has been optimized into a direct jump. There's no + real good way to fix up the reference to the deleted label + when the label is deleted, so we just allow it here. + + After dead code elimination is complete, we do search for + any REG_LABEL notes which reference deleted labels as a + sanity check. */ - if (inote) + if (inote && GET_CODE (inote) == CODE_LABEL) { rtx label = XEXP (inote, 0); rtx next; |