This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] shrink-wrap: Handle multiple predecessors of prologue
- From: Segher Boessenkool <segher at kernel dot crashing dot org>
- To: Bernd Schmidt <bschmidt at redhat dot com>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Tue, 22 Sep 2015 15:55:35 -0500
- Subject: Re: [PATCH] shrink-wrap: Handle multiple predecessors of prologue
- Authentication-results: sourceware.org; auth=none
- References: <52f14532eb742ac8d878a185a46a88da7b0326eb dot 1442588483 dot git dot segher at kernel dot crashing dot org> <55FFF06C dot 7090002 at redhat dot com> <20150921140159 dot GA18270 at gate dot crashing dot org> <5601780D dot 9000600 at redhat dot com> <20150922161146 dot GB3544 at gate dot crashing dot org>
On Tue, Sep 22, 2015 at 11:11:47AM -0500, Segher Boessenkool wrote:
> > So, given that your solution seems to work, the patch is ok.
>
> Thanks! Here is what I will commit after bootstrap+test (the superfluous
> assert removed, and the comment for the code quoted above tweaked a bit).
I added the following tiny patchlet for a paper bag problem revealed
by testing on x86-64. Committed together with the rest.
Segher
---
gcc/shrink-wrap.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/gcc/shrink-wrap.c b/gcc/shrink-wrap.c
index 94b1228..a99474d 100644
--- a/gcc/shrink-wrap.c
+++ b/gcc/shrink-wrap.c
@@ -822,6 +822,9 @@ try_shrink_wrapping (edge *entry_edge, bitmap_head *bb_with,
den += e->src->frequency;
}
+ if (den == 0)
+ den = 1;
+
/* All is okay, so do it. */
crtl->shrink_wrapped = true;
--
1.7.10.4