https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87288

--- Comment #9 from rsandifo at gcc dot gnu.org <rsandifo at gcc dot gnu.org> 
---
Author: rsandifo
Date: Thu Sep 20 12:58:23 2018
New Revision: 264440

URL: https://gcc.gnu.org/viewcvs?rev=264440&root=gcc&view=rev
Log:
Fix PEELING_FOR_NITERS calculation (PR 87288)

PEELING_FOR_GAPS now means "peel one iteration for the epilogue",
in much the same way that PEELING_FOR_ALIGNMENT > 0 means
"peel that number of iterations for the prologue".  We weren't
taking this into account when deciding whether we needed to peel
further scalar iterations beyond the iterations for "gaps" and
"alignment".

Only the first test failed before the patch.  The other two
are just for completeness.

2018-09-20  Richard Sandiford  <richard.sandif...@arm.com>

gcc/
        PR tree-optimization/87288
        * tree-vect-loop.c (vect_analyze_loop_2): Take PEELING_FOR_GAPS
        into account when determining PEELING_FOR_NITERS.

gcc/testsuite/
        PR tree-optimization/87288
        * gcc.dg/vect/pr87288-1.c: New test.
        * gcc.dg/vect/pr87288-2.c: Likewise,
        * gcc.dg/vect/pr87288-3.c: Likewise.

Added:
    trunk/gcc/testsuite/gcc.dg/vect/pr87288-1.c
    trunk/gcc/testsuite/gcc.dg/vect/pr87288-2.c
    trunk/gcc/testsuite/gcc.dg/vect/pr87288-3.c
Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/testsuite/ChangeLog
    trunk/gcc/tree-vect-loop.c

Reply via email to