From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 14270 invoked by alias); 6 Aug 2014 17:22:05 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 11555 invoked by uid 89); 6 Aug 2014 17:21:40 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.5 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; Wed, 06 Aug 2014 17:21:38 +0000 Received: from int-mx13.intmail.prod.int.phx2.redhat.com (int-mx13.intmail.prod.int.phx2.redhat.com [10.5.11.26]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id s76HL6o7006219 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Wed, 6 Aug 2014 13:21:06 -0400 Received: from c64.redhat.com (vpn-239-139.phx2.redhat.com [10.3.239.139]) by int-mx13.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id s76HJ2r9030913; Wed, 6 Aug 2014 13:21:05 -0400 From: David Malcolm To: gcc-patches@gcc.gnu.org Cc: David Malcolm Subject: [PATCH 213/236] rtl_data.x_nonlocal_goto_handler_labels becomes an rtx_expr_list Date: Wed, 06 Aug 2014 17:22:00 -0000 Message-Id: <1407345815-14551-214-git-send-email-dmalcolm@redhat.com> In-Reply-To: <1407345815-14551-1-git-send-email-dmalcolm@redhat.com> References: <1407345815-14551-1-git-send-email-dmalcolm@redhat.com> X-IsSubscribed: yes X-SW-Source: 2014-08/txt/msg00580.txt.bz2 gcc/ * function.h (struct rtl_data): Strengthen field x_nonlocal_goto_handler_labels from rtx to rtx_expr_list *. * rtl.h (remove_node_from_expr_list): Strengthen second param from rtx * to rtx_expr_list **. * cfgbuild.c (make_edges): In loop over nonlocal_goto_handler_labels, strengthen local "x" from rtx to rtx_expr_list *, and use methods of the latter class to clarify the code. * cfgrtl.c (cfg_layout_initialize): Strengthen local "x" from rtx to rtx_expr_list *, and use methods of the latter class to clarify the code. * dwarf2cfi.c (create_trace_edges): Likewise for local "lab". * reload1.c (set_initial_label_offsets): Likewise for local "x". * rtlanal.c (remove_node_from_expr_list): Strengthen param "listp" from rtx * to rtx_expr_list **. Strengthen local "temp" from rtx to rtx_expr_list *. Use methods of the latter class to clarify the code. --- gcc/cfgbuild.c | 6 ++++-- gcc/cfgrtl.c | 6 +++--- gcc/dwarf2cfi.c | 6 ++++-- gcc/function.h | 2 +- gcc/reload1.c | 6 +++--- gcc/rtl.h | 2 +- gcc/rtlanal.c | 12 ++++++------ 7 files changed, 22 insertions(+), 18 deletions(-) diff --git a/gcc/cfgbuild.c b/gcc/cfgbuild.c index 05adac0..082f070 100644 --- a/gcc/cfgbuild.c +++ b/gcc/cfgbuild.c @@ -337,8 +337,10 @@ make_edges (basic_block min, basic_block max, int update_p) taken, then only calls to those functions or to other nested functions that use them could possibly do nonlocal gotos. */ - for (rtx x = nonlocal_goto_handler_labels; x; x = XEXP (x, 1)) - make_label_edge (edge_cache, bb, XEXP (x, 0), + for (rtx_expr_list *x = nonlocal_goto_handler_labels; + x; + x = x->next ()) + make_label_edge (edge_cache, bb, x->element (), EDGE_ABNORMAL | EDGE_ABNORMAL_CALL); } diff --git a/gcc/cfgrtl.c b/gcc/cfgrtl.c index 0b385a1..59d633d 100644 --- a/gcc/cfgrtl.c +++ b/gcc/cfgrtl.c @@ -4219,7 +4219,7 @@ cfg_layout_duplicate_bb (basic_block bb) void cfg_layout_initialize (unsigned int flags) { - rtx x; + rtx_expr_list *x; basic_block bb; /* Once bb partitioning is complete, cfg layout mode should not be @@ -4238,9 +4238,9 @@ cfg_layout_initialize (unsigned int flags) record_effective_endpoints (); /* Make sure that the targets of non local gotos are marked. */ - for (x = nonlocal_goto_handler_labels; x; x = XEXP (x, 1)) + for (x = nonlocal_goto_handler_labels; x; x = x->next ()) { - bb = BLOCK_FOR_INSN (XEXP (x, 0)); + bb = BLOCK_FOR_INSN (x->element ()); bb->flags |= BB_NON_LOCAL_GOTO_TARGET; } diff --git a/gcc/dwarf2cfi.c b/gcc/dwarf2cfi.c index b5ea683..8d69285 100644 --- a/gcc/dwarf2cfi.c +++ b/gcc/dwarf2cfi.c @@ -2338,8 +2338,10 @@ create_trace_edges (rtx insn) /* Process non-local goto edges. */ if (can_nonlocal_goto (insn)) - for (rtx lab = nonlocal_goto_handler_labels; lab; lab = XEXP (lab, 1)) - maybe_record_trace_start_abnormal (XEXP (lab, 0), insn); + for (rtx_expr_list *lab = nonlocal_goto_handler_labels; + lab; + lab = lab->next ()) + maybe_record_trace_start_abnormal (lab->element (), insn); } else if (rtx_sequence *seq = dyn_cast (PATTERN (insn))) { diff --git a/gcc/function.h b/gcc/function.h index ba7597c..a176e0a 100644 --- a/gcc/function.h +++ b/gcc/function.h @@ -266,7 +266,7 @@ struct GTY(()) rtl_data { /* List (chain of EXPR_LIST) of labels heading the current handlers for nonlocal gotos. */ - rtx x_nonlocal_goto_handler_labels; + rtx_expr_list *x_nonlocal_goto_handler_labels; /* Label that will go on function epilogue. Jumping to this label serves as a "return" instruction diff --git a/gcc/reload1.c b/gcc/reload1.c index c669043..44d424f 100644 --- a/gcc/reload1.c +++ b/gcc/reload1.c @@ -3928,9 +3928,9 @@ set_initial_label_offsets (void) if (x->element ()) set_label_offsets (x->element (), NULL, 1); - for (rtx x = nonlocal_goto_handler_labels; x; x = XEXP (x, 1)) - if (XEXP (x, 0)) - set_label_offsets (XEXP (x, 0), NULL, 1); + for (rtx_expr_list *x = nonlocal_goto_handler_labels; x; x = x->next ()) + if (x->element ()) + set_label_offsets (x->element (), NULL, 1); for_each_eh_label (set_initial_eh_label_offset); } diff --git a/gcc/rtl.h b/gcc/rtl.h index 6fe89ec..afdc466 100644 --- a/gcc/rtl.h +++ b/gcc/rtl.h @@ -2804,7 +2804,7 @@ extern unsigned hash_rtx_cb (const_rtx, enum machine_mode, int *, int *, extern rtx regno_use_in (unsigned int, rtx); extern int auto_inc_p (const_rtx); extern int in_expr_list_p (const_rtx, const_rtx); -extern void remove_node_from_expr_list (const_rtx, rtx *); +extern void remove_node_from_expr_list (const_rtx, rtx_expr_list **); extern int loc_mentioned_in_p (rtx *, const_rtx); extern rtx_insn *find_first_parameter_load (rtx, rtx); extern bool keep_with_call_p (const_rtx); diff --git a/gcc/rtlanal.c b/gcc/rtlanal.c index bbec8fe..46a5fc1 100644 --- a/gcc/rtlanal.c +++ b/gcc/rtlanal.c @@ -2134,26 +2134,26 @@ in_expr_list_p (const_rtx listp, const_rtx node) A simple equality test is used to determine if NODE matches. */ void -remove_node_from_expr_list (const_rtx node, rtx *listp) +remove_node_from_expr_list (const_rtx node, rtx_expr_list **listp) { - rtx temp = *listp; + rtx_expr_list *temp = *listp; rtx prev = NULL_RTX; while (temp) { - if (node == XEXP (temp, 0)) + if (node == temp->element ()) { /* Splice the node out of the list. */ if (prev) - XEXP (prev, 1) = XEXP (temp, 1); + XEXP (prev, 1) = temp->next (); else - *listp = XEXP (temp, 1); + *listp = temp->next (); return; } prev = temp; - temp = XEXP (temp, 1); + temp = temp->next (); } } -- 1.8.5.3