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 <seg...@kernel.crashing.org> * 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);