This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug middle-end/60418] [4.9 Regression] 435.gromacs in SPEC CPU 2006 is miscompiled
- From: "hjl.tools at gmail dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Tue, 04 Mar 2014 23:31:06 +0000
- Subject: [Bug middle-end/60418] [4.9 Regression] 435.gromacs in SPEC CPU 2006 is miscompiled
- Auto-submitted: auto-generated
- References: <bug-60418-4 at http dot gcc dot gnu dot org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60418
--- Comment #1 from H.J. Lu <hjl.tools at gmail dot com> ---
Do we need to verify that basic block DEST has a single predecessor?
This patch works for me:
diff --git a/gcc/tree-cfgcleanup.c b/gcc/tree-cfgcleanup.c
index 926d300..0ed15df 100644
--- a/gcc/tree-cfgcleanup.c
+++ b/gcc/tree-cfgcleanup.c
@@ -316,6 +316,8 @@ tree_forwarder_block_p (basic_block bb, bool phi_wanted)
/* Protect loop preheaders and latches if requested. */
if (dest->loop_father->header == dest)
{
+ if (single_pred_p (dest))
+ {
if (bb->loop_father == dest->loop_father)
{
if (loops_state_satisfies_p (LOOPS_HAVE_SIMPLE_LATCHES))
@@ -329,6 +331,7 @@ tree_forwarder_block_p (basic_block bb, bool phi_wanted)
}
else if (bb->loop_father == loop_outer (dest->loop_father))
return !loops_state_satisfies_p (LOOPS_HAVE_PREHEADERS);
+ }
/* Always preserve other edges into loop headers that are
not simple latches or preheaders. */
return false;