This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH 3/3] function: Restructure *logue insertion
- From: Segher Boessenkool <segher at kernel dot crashing dot org>
- To: Thomas Schwinge <thomas at codesourcery dot com>
- Cc: gcc-patches at gcc dot gnu dot org, Jeff Law <law at redhat dot com>
- Date: Fri, 20 May 2016 16:27:16 -0500
- Subject: Re: [PATCH 3/3] function: Restructure *logue insertion
- Authentication-results: sourceware.org; auth=none
- References: <213485283eede9da12b217737d95fc8f5c4be442 dot 1463428211 dot git dot segher at kernel dot crashing dot org> <70c67b8f39aca9cf574f617fbfce43b93e2560ff dot 1463428211 dot git dot segher at kernel dot crashing dot org> <5236cc2d-fb6b-351d-2c9f-1c1419ddcf8a at redhat dot com> <20160519222046 dot GE8443 at gate dot crashing dot org> <87shxdt6x2 dot fsf at kepler dot schwinge dot homeip dot net>
On Fri, May 20, 2016 at 11:28:25AM +0200, Thomas Schwinge wrote:
> > > > * function.c (make_epilogue_seq): Remove epilogue_end parameter.
> > > > (thread_prologue_and_epilogue_insns): Remove bb_flags. Restructure
> > > > code. Ignore sibcalls on EDGE_IGNORE edges.
> > > > * shrink-wrap.c (handle_simple_exit): New function. Set EDGE_IGNORE
> > > > on edges for sibcalls that run without prologue. The rest of the
> > > > function is combined from...
> > > > (fix_fake_fallthrough_edge): ... this, and ...
> > > > (try_shrink_wrapping): ... a part of this. Remove the bb_with
> > > > function argument, make it a local variable.
>
> On Thu, 19 May 2016 17:20:46 -0500, Segher Boessenkool <segher@kernel.crashing.org> wrote:
> > On Thu, May 19, 2016 at 04:00:22PM -0600, Jeff Law wrote:
> > > OK for the trunk, but please watch closely for any fallout.
> >
> > Thanks, and I will!
>
> With nvptx offloading on x86_64 GNU/Linux, this (r236491) is causing
> several execution test failures. I'll have a look.
nvptx calls thread_prologue_and_epilogue_insns directly. It seems in
the "normal" way there always is a commit_edge_insertions afterwards,
but for nvptx there isn't. thrread_prologue_and_epilogue_insertions
should do it itself, of course. This patch fixes it; regression tested
on powerpc64-linux, and Thomas says it looks good on nvptx. Committing
to trunk as obvious.
Segher
===
This fixes a bug in my r236491: on nvptx, functions without prologue
would not get an epilogue either.
2016-05-20 Segher Boessenkool <segher@kernel.crashing.org>
* function.c (thread_prologue_and_epilogue_insns): Commit the
insertion of the epilogue.
---
gcc/function.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/gcc/function.c b/gcc/function.c
index 25e0e0c..b517012 100644
--- a/gcc/function.c
+++ b/gcc/function.c
@@ -5977,6 +5977,7 @@ thread_prologue_and_epilogue_insns (void)
if (epilogue_seq)
{
insert_insn_on_edge (epilogue_seq, exit_fallthru_edge);
+ commit_edge_insertions ();
/* The epilogue insns we inserted may cause the exit edge to no longer
be fallthru. */
--
1.9.3