From patchwork Fri Sep 5 01:51:58 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Malcolm X-Patchwork-Id: 386074 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id CDE10140088 for ; Fri, 5 Sep 2014 11:47:24 +1000 (EST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :to:cc:subject:date:message-id:in-reply-to:references; q=dns; s= default; b=UnGkfR4meui6cP5iBl5+DtuPX9UgAU0JPZUEwP/Au+uHcxBWma4zR pDLoKn5BDuya30UmHt5PgteIeYad3zepaXAsUh9K2U6QINFrFCJXDVZltuXKvzAm CznUO2C9P/S9S3q1q1q4VBnITAqPGWEHRGcRE9pJJCgoUd1is0lziw= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :to:cc:subject:date:message-id:in-reply-to:references; s= default; bh=KmL3Pd2RYwXSP72leZvNhJk0+qw=; b=QO6c5GgC4bRclKwNut9w 6wmIl+tQE12kzKGwvpwn3W68SFHMpB6muFb/Cw80BZzjhI0+L6oZYffgdJguG+54 vbLXvnHrAImGRbE4UCy5LebVDEY75xfefu39YYmRZ379vTrV6nqJ6NjnVoedjGMI 0V/KqxALuLegBAtYt0w9AtM= Received: (qmail 15105 invoked by alias); 5 Sep 2014 01:47:05 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Received: (qmail 14899 invoked by uid 89); 5 Sep 2014 01:47:03 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-3.0 required=5.0 tests=AWL, BAYES_00, RP_MATCHES_RCVD, SPF_HELO_PASS, SPF_PASS autolearn=ham version=3.3.2 X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-GCM-SHA384 encrypted) ESMTPS; Fri, 05 Sep 2014 01:47:02 +0000 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id s851l07x029069 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL) for ; Thu, 4 Sep 2014 21:47:01 -0400 Received: from c64.redhat.com (vpn-228-103.phx2.redhat.com [10.3.228.103]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id s851kw8d012763; Thu, 4 Sep 2014 21:46:59 -0400 From: David Malcolm To: gcc-patches@gcc.gnu.org Cc: David Malcolm Subject: [PATCH 01/10] Use rtx_jump_table_data in jump.c:delete_related_insns Date: Thu, 4 Sep 2014 21:51:58 -0400 Message-Id: <1409881927-61672-2-git-send-email-dmalcolm@redhat.com> In-Reply-To: <1409881927-61672-1-git-send-email-dmalcolm@redhat.com> References: <1409881927-61672-1-git-send-email-dmalcolm@redhat.com> X-IsSubscribed: yes gcc/ * jump.c (delete_related_insns): Introduce a new local "table" by replacing JUMP_TABLE_DATA_P with a dyn_cast, then use the get_labels method of "table" to simplify access to the labels in the jump table. --- gcc/jump.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/gcc/jump.c b/gcc/jump.c index 12edd92..84040da 100644 --- a/gcc/jump.c +++ b/gcc/jump.c @@ -1314,15 +1314,15 @@ delete_related_insns (rtx uncast_insn) /* Likewise if we're deleting a dispatch table. */ - if (JUMP_TABLE_DATA_P (insn)) + if (rtx_jump_table_data *table = dyn_cast (insn)) { - rtx pat = PATTERN (insn); - int i, diff_vec_p = GET_CODE (pat) == ADDR_DIFF_VEC; - int len = XVECLEN (pat, diff_vec_p); + rtvec labels = table->get_labels (); + int i; + int len = GET_NUM_ELEM (labels); for (i = 0; i < len; i++) - if (LABEL_NUSES (XEXP (XVECEXP (pat, diff_vec_p, i), 0)) == 0) - delete_related_insns (XEXP (XVECEXP (pat, diff_vec_p, i), 0)); + if (LABEL_NUSES (XEXP (RTVEC_ELT (labels, i), 0)) == 0) + delete_related_insns (XEXP (RTVEC_ELT (labels, i), 0)); while (next && INSN_DELETED_P (next)) next = NEXT_INSN (next); return next;