This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [patch]: [Bug tree-optimization/61917] [4.9/5 Regression] ICE on valid code at -O3 on x86_64-linux-gnu in vectorizable_reduction, at tree-vect-loop.c:4913
- From: Richard Biener <richard dot guenther at gmail dot com>
- To: Kai Tietz <ktietz70 at googlemail dot com>
- Cc: GCC Patches <gcc-patches at gcc dot gnu dot org>, Jakub Jelinek <jakub at redhat dot com>
- Date: Wed, 25 Feb 2015 11:57:51 +0100
- Subject: Re: [patch]: [Bug tree-optimization/61917] [4.9/5 Regression] ICE on valid code at -O3 on x86_64-linux-gnu in vectorizable_reduction, at tree-vect-loop.c:4913
- Authentication-results: sourceware.org; auth=none
- References: <CAEwic4bmgzFQDMyGb6sq+VOU788dx54UJ2X0_bXkPv+WAmP4Yw at mail dot gmail dot com>
On Wed, Feb 25, 2015 at 11:06 AM, Kai Tietz <ktietz70@googlemail.com> wrote:
> Hello,
>
> ChangeLog
>
> 2015-02-25 Kai Tietz <ktietz@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 <ktietz@redhat.com>
>
> PR tree-optimization/61917
> * gcc.dg/vect/vect-pr61917.c: New file.
>
> Tested for x86_64-unkown-linux. Ok for apply?
It doesn't make much sense to fail here as said in the comment
because of patterns if the actual case isn't a pattern. Also
the patch causing this made vect_external_def possible, so
why does this affect vect_internal_def here?
It may paper over the issue - but clearly the fix is bogus.
Richard.
> Regards,
> Kai
>
> Index: tree-vect-loop.c
> ===================================================================
> --- tree-vect-loop.c (Revision 220958)
> +++ tree-vect-loop.c (Arbeitskopie)
> @@ -4990,7 +4990,7 @@ vectorizable_reduction (gimple stmt, gimple_stmt_i
> /* For pattern recognized stmts, orig_stmt might be a reduction,
> but some helper statements for the pattern might not, or
> might be COND_EXPRs with reduction uses in the condition. */
> - gcc_assert (orig_stmt);
> + gcc_assert (orig_stmt || dt == vect_internal_def);
> return false;
> }
> if (!found_nested_cycle_def)
> 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;
> +}