This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH 2/3] function: Factor out make_*logue_seq
- From: Segher Boessenkool <segher at kernel dot crashing dot org>
- To: Jakub Jelinek <jakub at redhat dot com>
- Cc: "H.J. Lu" <hjl dot tools at gmail dot com>, GCC Patches <gcc-patches at gcc dot gnu dot org>
- Date: Thu, 19 May 2016 02:28:15 -0500
- Subject: Re: [PATCH 2/3] function: Factor out make_*logue_seq
- Authentication-results: sourceware.org; auth=none
- References: <213485283eede9da12b217737d95fc8f5c4be442 dot 1463428211 dot git dot segher at kernel dot crashing dot org> <d3064210448ea1d2d7758a3a34e554902333eef2 dot 1463428211 dot git dot segher at kernel dot crashing dot org> <CAMe9rOqs2BsvHNmCgRXDtpOZwxKLotd2xw_4B9oKEsx-qft6Ag at mail dot gmail dot com> <20160518181139 dot GA24289 at gate dot crashing dot org> <CAMe9rOrQmt-avt-NSnRnQxmnL5g6TfJtPUMnY-MLfp_WuwyYCw at mail dot gmail dot com> <20160518183516 dot GB24289 at gate dot crashing dot org> <20160518221325 dot GB8384 at gate dot crashing dot org> <20160519071626 dot GY28550 at tucnak dot redhat dot com>
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 <segher@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);