From: Richard Henderson Date: Wed, 4 Aug 1999 08:19:36 +0000 (-0700) Subject: * jump.c (delete_insn): Delete the addr_vec when deleting a tablejump. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=1fe659304f728671fd9d01c412cbf5ac586f88af;p=gcc.git * jump.c (delete_insn): Delete the addr_vec when deleting a tablejump. From-SVN: r28492 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index b17ccd33860..a28bc6953d8 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,7 @@ +Wed Aug 4 02:15:32 1999 Richard Henderson + + * jump.c (delete_insn): Delete the addr_vec when deleting a tablejump. + Wed Aug 4 01:48:08 1999 Jim Kingdon * global.c: Fix comment. diff --git a/gcc/jump.c b/gcc/jump.c index 295a6c117ba..da81b5a6d44 100644 --- a/gcc/jump.c +++ b/gcc/jump.c @@ -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. */