diff options
author | Richard Henderson <rth@cygnus.com> | 1999-08-04 01:19:36 -0700 |
---|---|---|
committer | Jeff Law <law@gcc.gnu.org> | 1999-08-04 02:19:36 -0600 |
commit | 1fe659304f728671fd9d01c412cbf5ac586f88af (patch) | |
tree | c674959efd5afb82fb5f3be34d1ab45cf5ac2321 /gcc | |
parent | dbd83e11788d86dbfd159a804efd25709527daee (diff) | |
download | gcc-1fe659304f728671fd9d01c412cbf5ac586f88af.zip gcc-1fe659304f728671fd9d01c412cbf5ac586f88af.tar.gz gcc-1fe659304f728671fd9d01c412cbf5ac586f88af.tar.bz2 |
* jump.c (delete_insn): Delete the addr_vec when deleting a tablejump.
From-SVN: r28492
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ChangeLog | 4 | ||||
-rw-r--r-- | gcc/jump.c | 44 |
2 files changed, 34 insertions, 14 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index b17ccd3..a28bc69 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,7 @@ +Wed Aug 4 02:15:32 1999 Richard Henderson <rth@cygnus.com> + + * jump.c (delete_insn): Delete the addr_vec when deleting a tablejump. + Wed Aug 4 01:48:08 1999 Jim Kingdon <http://developer.redhat.com> * global.c: Fix comment. @@ -4017,20 +4017,36 @@ delete_insn (insn) and delete the label if it is now unused. */ if (GET_CODE (insn) == JUMP_INSN && JUMP_LABEL (insn)) - if (--LABEL_NUSES (JUMP_LABEL (insn)) == 0) - { - /* This can delete NEXT or PREV, - either directly if NEXT is JUMP_LABEL (INSN), - or indirectly through more levels of jumps. */ - delete_insn (JUMP_LABEL (insn)); - /* I feel a little doubtful about this loop, - but I see no clean and sure alternative way - to find the first insn after INSN that is not now deleted. - I hope this works. */ - while (next && INSN_DELETED_P (next)) - next = NEXT_INSN (next); - return next; - } + { + rtx lab = JUMP_LABEL (insn), lab_next; + + if (--LABEL_NUSES (lab) == 0) + { + /* This can delete NEXT or PREV, + either directly if NEXT is JUMP_LABEL (INSN), + or indirectly through more levels of jumps. */ + delete_insn (lab); + + /* I feel a little doubtful about this loop, + but I see no clean and sure alternative way + to find the first insn after INSN that is not now deleted. + I hope this works. */ + while (next && INSN_DELETED_P (next)) + next = NEXT_INSN (next); + return next; + } + else if ((lab_next = next_nonnote_insn (lab)) != NULL + && GET_CODE (lab_next) == JUMP_INSN + && (GET_CODE (PATTERN (lab_next)) == ADDR_VEC + || GET_CODE (PATTERN (lab_next)) == ADDR_DIFF_VEC)) + { + /* If we're deleting the tablejump, delete the dispatch table. + We may not be able to kill the label immediately preceeding + just yet, as it might be referenced in code leading up to + the tablejump. */ + delete_insn (lab_next); + } + } /* Likewise if we're deleting a dispatch table. */ |