From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 46641 invoked by alias); 19 May 2016 07:28:36 -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 46627 invoked by uid 89); 19 May 2016 07:28:35 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.8 required=5.0 tests=AWL,BAYES_00,RP_MATCHES_RCVD,SPF_HELO_PASS,SPF_PASS autolearn=ham version=3.3.2 spammy=sk:insert_, Hx-languages-length:2692, 2016-05-19, 20160519 X-HELO: gate.crashing.org Received: from gate.crashing.org (HELO gate.crashing.org) (63.228.1.57) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-SHA encrypted) ESMTPS; Thu, 19 May 2016 07:28:25 +0000 Received: from gate.crashing.org (localhost.localdomain [127.0.0.1]) by gate.crashing.org (8.14.1/8.13.8) with ESMTP id u4J7SG2l008257; Thu, 19 May 2016 02:28:16 -0500 Received: (from segher@localhost) by gate.crashing.org (8.14.1/8.14.1/Submit) id u4J7SGl5008256; Thu, 19 May 2016 02:28:16 -0500 Date: Thu, 19 May 2016 07:28:00 -0000 From: Segher Boessenkool To: Jakub Jelinek Cc: "H.J. Lu" , GCC Patches Subject: Re: [PATCH 2/3] function: Factor out make_*logue_seq Message-ID: <20160519072815.GA6926@gate.crashing.org> References: <213485283eede9da12b217737d95fc8f5c4be442.1463428211.git.segher@kernel.crashing.org> <20160518181139.GA24289@gate.crashing.org> <20160518183516.GB24289@gate.crashing.org> <20160518221325.GB8384@gate.crashing.org> <20160519071626.GY28550@tucnak.redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160519071626.GY28550@tucnak.redhat.com> User-Agent: Mutt/1.4.2.3i X-IsSubscribed: yes X-SW-Source: 2016-05/txt/msg01433.txt.bz2 On Thu, May 19, 2016 at 09:16:26AM +0200, Jakub Jelinek wrote: > On Wed, May 18, 2016 at 05:13:25PM -0500, Segher Boessenkool wrote: > > On Wed, May 18, 2016 at 01:35:16PM -0500, Segher Boessenkool wrote: > > > On Wed, May 18, 2016 at 11:20:29AM -0700, H.J. Lu wrote: > > > > >> > * function.c (make_split_prologue_seq, make_prologue_seq, > > > > >> > make_epilogue_seq): New functions, factored out from... > > > > >> > (thread_prologue_and_epilogue_insns): Here. > > > > >> > > > > >> It breaks x86: > > > > > > > > > > Are you sure it is this patch causing it? As noted, it was tested on x86. > > > > > > > > I am pretty sure. How did you test it on x86? > > > > > > "make -k check". I'll test 32-bit now. > > > > Actually, it also fails on 64 bit. It passed my testing because it does > > not fail together with patch 3/3, and does not fail on powerpc at all. > > If 3/3 isn't approved soon, can you please revert the problematic commit > until it is if that patch can't work right on its own and needs the other > patch too)? The trunk is in terrible state right now at least on > x86_64/i686-linux, various tests hang forever (e.g. some cleanup-* tests) > and there are hundreds of failures, making it impossible to do proper > regression testing. [ You could just revert it locally if it hinders other testing -- I have to do that all the time for pawtches breaking powerpc ]. The following fixes it, tested on x86_64-linux. Is it okay for trunk? (It only happens for targets that have a splitter gated by epilogue_done for their eh_return pattern). Segher 2016-05-19 Segher Boessenkool * function.c (thread_prologue_and_epilogue_insn): Move the "goto epilogue_done" one block later. diff --git a/gcc/function.c b/gcc/function.c index 1c56253..4c236eb 100644 --- a/gcc/function.c +++ b/gcc/function.c @@ -5960,11 +5960,6 @@ thread_prologue_and_epilogue_insns (void) exit_fallthru_edge = find_fallthru_edge (EXIT_BLOCK_PTR_FOR_FN (cfun)->preds); - /* If nothing falls through into the exit block, we don't need an - epilogue. */ - if (exit_fallthru_edge == NULL) - goto epilogue_done; - /* A small fib -- epilogue is not yet completed, but we wish to re-use this marker for the splits of EH_RETURN patterns, and nothing else uses the flag in the meantime. */ @@ -5994,6 +5989,11 @@ thread_prologue_and_epilogue_insns (void) emit_note_after (NOTE_INSN_EPILOGUE_BEG, prev); } + /* If nothing falls through into the exit block, we don't need an + epilogue. */ + if (exit_fallthru_edge == NULL) + goto epilogue_done; + if (epilogue_seq) { insert_insn_on_edge (epilogue_seq, exit_fallthru_edge);