[Bug middle-end/60418] [4.9 Regression] 435.gromacs in SPEC CPU 2006 is miscompiled

rguenther at suse dot de gcc-bugzilla@gcc.gnu.org
Wed Mar 12 08:54:00 GMT 2014


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60418

--- Comment #28 from rguenther at suse dot de <rguenther at suse dot de> ---
On Tue, 11 Mar 2014, hjl.tools at gmail dot com wrote:

> http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60418
> 
> --- Comment #26 from H.J. Lu <hjl.tools at gmail dot com> ---
> This patch avoids removing preheader when optimizing since
> preheader will be added back later even if it is removed:
> 
> diff --git a/gcc/tree-cfgcleanup.c b/gcc/tree-cfgcleanup.c
> index 926d300..af5b24b 100644
> --- a/gcc/tree-cfgcleanup.c
> +++ b/gcc/tree-cfgcleanup.c
> @@ -328,7 +328,10 @@ tree_forwarder_block_p (basic_block bb, bool phi_wanted)
>                   (LOOPS_MAY_HAVE_MULTIPLE_LATCHES));
>        }
>      else if (bb->loop_father == loop_outer (dest->loop_father))
> -      return !loops_state_satisfies_p (LOOPS_HAVE_PREHEADERS);
> +      /* Preserve preheader when optimizing since it will be added
> +         back later.  */
> +      return !(optimize
> +          || loops_state_satisfies_p (LOOPS_HAVE_PREHEADERS));
>      /* Always preserve other edges into loop headers that are
>         not simple latches or preheaders.  */
>      return false;

HJ, these patches don't make sense - this patch will regress the
testcase the code above was introduced for.



More information about the Gcc-bugs mailing list