This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug tree-optimization/85286] [8 Regression] ICE in exact_div, at poly-int.h:2139


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

--- Comment #4 from rsandifo at gcc dot gnu.org <rsandifo at gcc dot gnu.org> ---
Author: rsandifo
Date: Tue Apr 10 10:28:33 2018
New Revision: 259268

URL: https://gcc.gnu.org/viewcvs?rev=259268&root=gcc&view=rev
Log:
Add missing cases to vect_get_smallest_scalar_type (PR 85286)

In this PR we used WIDEN_SUM_EXPR to vectorise:

  short i, y;
  int sum;
  [...]
  for (i = x; i > 0; i--)
    sum += y;

with 4 ints and 8 shorts per vector.  The problem was that we set
the VF based only on the ints, then calculated the number of vector
copies based on the shorts, giving 4/8.  Previously that led to
ncopies==0, but after r249897 we pick it up as an ICE.

In this particular case we could vectorise the reduction by setting
ncopies based on the output type rather than the input type, but it
doesn't seem worth adding a special "optimisation" for such a
pathological case.  I think it's really an instance of the more general
problem that we can't vectorise using combinations of (say) 64-bit and
128-bit vectors on targets that support both.

2018-04-10  Richard Sandiford  <richard.sandiford@linaro.org>

gcc/
        PR tree-optimization/85286
        * tree-vect-data-refs.c (vect_get_smallest_scalar_type):

gcc/testsuite/
        PR tree-optimization/85286
        * gcc.dg/vect/pr85286.c: New test.

Added:
    trunk/gcc/testsuite/gcc.dg/vect/pr85286.c
Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/testsuite/ChangeLog
    trunk/gcc/tree-vect-data-refs.c

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]