On Wed, Feb 25, 2015 at 2:10 PM, Kai Tietz <ktiet...@googlemail.com> wrote:
> Hello,
>
> So, I did full regression-test for following patch:
>
> ChangeLog
>
> 2015-02-25  Richard Biener  <rguent...@suse.de>
>     Kai Tietz  <kti...@redhat.com>
>
>     PR tree-optimization/61917
>     * tree-vect-loop.c (vectorizable_reduction): Allow
>     vect_internal_def without reduction to exit graceful.
>
> ChagneLog testsuite/
>
> 2015-02-25  Kai Tietz  <kti...@redhat.com>
>
>     PR tree-optimization/61917
>     * gcc.dg/vect/vect-pr61917.c: New file.
>
> Tested for x86_64-unkown-linux.  Ok for apply?

Ok.

Thanks,
Richard.

> Regards,
> Kai
>
> Index: tree-vect-loop.c
> ===================================================================
> --- tree-vect-loop.c    (Revision 220958)
> +++ tree-vect-loop.c    (Arbeitskopie)
> @@ -4981,6 +4981,12 @@ vectorizable_reduction (gimple stmt, gimple_stmt_i
>    if (!vectype_in)
>      vectype_in = tem;
>    gcc_assert (is_simple_use);
> +  if (!found_nested_cycle_def)
> +    reduc_def_stmt = def_stmt;
> +
> +  if (gimple_code (reduc_def_stmt) != GIMPLE_PHI)
> +    return false;
> +
>    if (!(dt == vect_reduction_def
>      || dt == vect_nested_cycle
>      || ((dt == vect_internal_def || dt == vect_external_def
> @@ -4993,10 +4999,7 @@ vectorizable_reduction (gimple stmt, gimple_stmt_i
>        gcc_assert (orig_stmt);
>        return false;
>      }
> -  if (!found_nested_cycle_def)
> -    reduc_def_stmt = def_stmt;
>
> -  gcc_assert (gimple_code (reduc_def_stmt) == GIMPLE_PHI);
>    if (orig_stmt)
>      gcc_assert (orig_stmt == vect_is_simple_reduction (loop_vinfo,
>                                                         reduc_def_stmt,
> Index: gcc/gcc/testsuite/gcc.dg/vect/vect-pr61917.c
> ===================================================================
> --- /dev/null
> +++ gcc/gcc/testsuite/gcc.dg/vect/vect-pr61917.c
> @@ -0,0 +1,13 @@
> +/* { dg-do compile } */
> +/* { dg-additional-options "-O3" } */
> +
> +int a, b, c, d;
> +
> +int
> +fn1 ()
> +{
> +  for (; c; c++)
> +    for (b = 0; b < 2; b++)
> +      d = a - d;
> +  return d;
> +}

Reply via email to