From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 7994 invoked by alias); 19 Aug 2014 21:12:17 -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 7983 invoked by uid 89); 19 Aug 2014 21:12:16 -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; Tue, 19 Aug 2014 21:12:14 +0000 Received: from int-mx14.intmail.prod.int.phx2.redhat.com (int-mx14.intmail.prod.int.phx2.redhat.com [10.5.11.27]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id s7JLCDvT006711 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Tue, 19 Aug 2014 17:12:13 -0400 Received: from [10.3.225.110] (vpn-225-110.phx2.redhat.com [10.3.225.110]) by int-mx14.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id s7JLCCtT019945; Tue, 19 Aug 2014 17:12:12 -0400 Message-ID: <1408482544.2473.119.camel@surprise> Subject: Re: [PATCH 034/236] next_cc0_user and prev_cc0_setter scaffolding From: David Malcolm To: Jeff Law Cc: gcc-patches@gcc.gnu.org Date: Tue, 19 Aug 2014 21:12:00 -0000 In-Reply-To: <53EBA6AD.3080809@redhat.com> References: <1407345815-14551-1-git-send-email-dmalcolm@redhat.com> <1407345815-14551-35-git-send-email-dmalcolm@redhat.com> <53EBA6AD.3080809@redhat.com> Content-Type: multipart/mixed; boundary="=-yC+hy5Li9mNNgqFatdrz" Mime-Version: 1.0 X-IsSubscribed: yes X-SW-Source: 2014-08/txt/msg01956.txt.bz2 --=-yC+hy5Li9mNNgqFatdrz Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit Content-length: 746 On Wed, 2014-08-13 at 11:55 -0600, Jeff Law wrote: > On 08/06/14 11:20, David Malcolm wrote: > > gcc/ > > * rtl.h (next_cc0_user): Strengthen return type from rtx to > > rtx_insn *. > > (prev_cc0_setter): Likewise. > > > > * emit-rtl.c (next_cc0_user): Strengthen return type from rtx to > > rtx_insn *, adding checked casts for now as necessary. > > (prev_cc0_setter): Likewise. > OK. Thanks. Fixed up for as_a_nullable -> safe_as_a, and committed to trunk as r214196, having bootstrapped®rtested on x86_64-unknown-linux-gnu (Fedora 20) albeit in combination with patches 30-39, and verified that it builds standalone both for that target, and for pdp11-aout, the latter to give coverage for HAVE_cc0. Am attaching what I committed. --=-yC+hy5Li9mNNgqFatdrz Content-Disposition: attachment; filename="r214196.patch" Content-Type: text/x-patch; name="r214196.patch"; charset="UTF-8" Content-Transfer-Encoding: 7bit Content-length: 2434 Index: gcc/ChangeLog =================================================================== --- gcc/ChangeLog (revision 214195) +++ gcc/ChangeLog (revision 214196) @@ -1,5 +1,15 @@ 2014-08-19 David Malcolm + * rtl.h (next_cc0_user): Strengthen return type from rtx to + rtx_insn *. + (prev_cc0_setter): Likewise. + + * emit-rtl.c (next_cc0_user): Strengthen return type from rtx to + rtx_insn *, adding checked casts for now as necessary. + (prev_cc0_setter): Likewise. + +2014-08-19 David Malcolm + * expr.h (emit_move_insn): Strengthen return type from rtx to rtx_insn *. (emit_move_insn_1): Likewise. Index: gcc/emit-rtl.c =================================================================== --- gcc/emit-rtl.c (revision 214195) +++ gcc/emit-rtl.c (revision 214196) @@ -3450,13 +3450,13 @@ Return 0 if we can't find the insn. */ -rtx +rtx_insn * next_cc0_user (rtx insn) { rtx note = find_reg_note (insn, REG_CC_USER, NULL_RTX); if (note) - return XEXP (note, 0); + return safe_as_a (XEXP (note, 0)); insn = next_nonnote_insn (insn); if (insn && NONJUMP_INSN_P (insn) && GET_CODE (PATTERN (insn)) == SEQUENCE) @@ -3463,7 +3463,7 @@ insn = XVECEXP (PATTERN (insn), 0, 0); if (insn && INSN_P (insn) && reg_mentioned_p (cc0_rtx, PATTERN (insn))) - return insn; + return safe_as_a (insn); return 0; } @@ -3471,18 +3471,18 @@ /* Find the insn that set CC0 for INSN. Unless INSN has a REG_CC_SETTER note, it is the previous insn. */ -rtx +rtx_insn * prev_cc0_setter (rtx insn) { rtx note = find_reg_note (insn, REG_CC_SETTER, NULL_RTX); if (note) - return XEXP (note, 0); + return safe_as_a (XEXP (note, 0)); insn = prev_nonnote_insn (insn); gcc_assert (sets_cc0_p (PATTERN (insn))); - return insn; + return safe_as_a (insn); } #endif Index: gcc/rtl.h =================================================================== --- gcc/rtl.h (revision 214195) +++ gcc/rtl.h (revision 214196) @@ -2440,8 +2440,8 @@ extern rtx_insn *prev_active_insn (rtx); extern rtx_insn *next_active_insn (rtx); extern int active_insn_p (const_rtx); -extern rtx next_cc0_user (rtx); -extern rtx prev_cc0_setter (rtx); +extern rtx_insn *next_cc0_user (rtx); +extern rtx_insn *prev_cc0_setter (rtx); /* In emit-rtl.c */ extern int insn_line (const_rtx); --=-yC+hy5Li9mNNgqFatdrz--