From 3c7d7a4a7dddd51c8349bfb9cc71e3db1a4deeee Mon Sep 17 00:00:00 2001 From: Doug Evans Date: Tue, 15 Nov 1994 15:36:58 +0000 Subject: [PATCH] (delete_insn): Delete labels in ADDR_VECs and ADDR_DIFF_VECs if their use count becomes zero. From-SVN: r8439 --- gcc/jump.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/gcc/jump.c b/gcc/jump.c index 28d25e52d12..e42e5f13f3e 100644 --- a/gcc/jump.c +++ b/gcc/jump.c @@ -3375,6 +3375,24 @@ delete_insn (insn) return next; } + /* Likewise if we're deleting a dispatch table. */ + + if (GET_CODE (insn) == JUMP_INSN + && (GET_CODE (PATTERN (insn)) == ADDR_VEC + || GET_CODE (PATTERN (insn)) == ADDR_DIFF_VEC)) + { + rtx pat = PATTERN (insn); + int i, diff_vec_p = GET_CODE (pat) == ADDR_DIFF_VEC; + int len = XVECLEN (pat, diff_vec_p); + + for (i = 0; i < len; i++) + if (--LABEL_NUSES (XEXP (XVECEXP (pat, diff_vec_p, i), 0)) == 0) + delete_insn (XEXP (XVECEXP (pat, diff_vec_p, i), 0)); + while (next && INSN_DELETED_P (next)) + next = NEXT_INSN (next); + return next; + } + while (prev && (INSN_DELETED_P (prev) || GET_CODE (prev) == NOTE)) prev = PREV_INSN (prev);