From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 9501 invoked by alias); 29 Aug 2014 00:09:02 -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 9489 invoked by uid 89); 29 Aug 2014 00:09:01 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.2 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=ham version=3.3.2 X-HELO: mail-oi0-f54.google.com Received: from mail-oi0-f54.google.com (HELO mail-oi0-f54.google.com) (209.85.218.54) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-SHA encrypted) ESMTPS; Fri, 29 Aug 2014 00:08:59 +0000 Received: by mail-oi0-f54.google.com with SMTP id a3so1089461oib.13 for ; Thu, 28 Aug 2014 17:08:57 -0700 (PDT) MIME-Version: 1.0 X-Received: by 10.182.249.52 with SMTP id yr20mr7183607obc.10.1409270937738; Thu, 28 Aug 2014 17:08:57 -0700 (PDT) Received: by 10.76.72.4 with HTTP; Thu, 28 Aug 2014 17:08:57 -0700 (PDT) In-Reply-To: <1409073313.24896.42.camel@surprise> References: <1407345815-14551-1-git-send-email-dmalcolm@redhat.com> <1407345815-14551-226-git-send-email-dmalcolm@redhat.com> <53F3BA30.4050301@redhat.com> <1408484146.2473.128.camel@surprise> <53FB4743.5030103@redhat.com> <1409073313.24896.42.camel@surprise> Date: Fri, 29 Aug 2014 00:09:00 -0000 Message-ID: Subject: Re: [PATCH 225/236] Work towards NEXT_INSN/PREV_INSN requiring insns as their params From: "H.J. Lu" To: David Malcolm Cc: Jeff Law , Richard Henderson , GCC Patches Content-Type: text/plain; charset=UTF-8 X-IsSubscribed: yes X-SW-Source: 2014-08/txt/msg02612.txt.bz2 On Tue, Aug 26, 2014 at 10:15 AM, David Malcolm wrote: > On Mon, 2014-08-25 at 08:25 -0600, Jeff Law wrote: >> On 08/19/14 15:35, David Malcolm wrote: >> > On Tue, 2014-08-19 at 13:57 -0700, Richard Henderson wrote: >> >> On 08/06/2014 10:23 AM, David Malcolm wrote: >> >>> diff --git a/gcc/cfgrtl.c b/gcc/cfgrtl.c >> >>> index 59d633d..5e42a97 100644 >> >>> --- a/gcc/cfgrtl.c >> >>> +++ b/gcc/cfgrtl.c >> >>> @@ -1604,6 +1604,7 @@ force_nonfallthru_and_redirect (edge e, basic_block target, rtx jump_label) >> >>> >> >>> if (EDGE_COUNT (e->src->succs) >= 2 || abnormal_edge_flags || asm_goto_edge) >> >>> { >> >>> + rtx_insn *note; >> >>> gcov_type count = e->count; >> >>> int probability = e->probability; >> >>> /* Create the new structures. */ >> >> >> >> A new variable with no uses? >> > >> > This one is quite ugly: the pre-existing code has two locals named >> > "note", both of type rtx, with one shadowing the other. This patch >> > introduces a third, within the scope where the name "note" is used for >> > insns. In the other scopes the two other "note" variables are used for >> > find_reg_note. In each case, the name "note" is written to before use. >> > >> > So in my defense, the existing code already had shadowing of locals... >> > but I guess that's not much of a defense, and it would be better to >> > introduce a different name, and rename the uses in the appropriate >> > scope. >> If it's reasonable to do this now, then please do so. Else make it a >> follow-up item. I guess we should have had a list of follow-up items :-) >> >> jeff > > Attached is a revised version of #225, with the following changes: > > * fix for the above: avoid introducing a new shadow name "note" within > force_nonfallthru_and_redirect by introducing a new local rtx_insn * > "new_head" and renaming "note" to it in the appropriate places. > > * changed an as_a<> to a safe_as_a<> within > function.c:thread_prologue_and_epilogue_insns to fix a segfault seen > during an earlier bootstrap > > Successfully bootstrapped on x86_64 (Fedora 20), on top of the rest of > the patches leading up to it (including the revised ones for #220-#221 > that rth recently approved). > > OK for trunk? > Dave One of your changes caused: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=62300 -- H.J.