[Bug tree-optimization/104112] [12 Regression] ICE with -Ofast -march=armv8.2-a+sve -msve-vector-bits=512 since r12-2292-g1dd3f21095858fbfd3e28a149578d5fb67e75f95

rguenth at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Wed Jan 19 12:12:47 GMT 2022


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

--- Comment #10 from Richard Biener <rguenth at gcc dot gnu.org> ---
On i?86 we could eventually hit the same issue with

unsigned short foo (unsigned short *a, int n)
{
  unsigned short sum = 0;
  for (int i = 0; i < n; ++i)
    sum += a[i];
  return sum;
}

since V8HI is available with SSE2 but V4HI is limited (no add) because of
the fear of MMX but then we make V2HI available again but epilogue
vectorization with V2HI isn't considered profitable.  Disabling the
cost model produces V4HI ops even though the mode was not advertised
(or we failed to iterate over that mode for some reason).  The V4HI
adds are also code generated by the vectorizer but later decomposed
by vector lowering so the generated code is a bit awful.

That said, i?86 does have V4HImode support but not V4HImode adds
(V4HI would also match word_mode, not sure if we'd ever select that
via get_related_vectype_for_scalar_type).


More information about the Gcc-bugs mailing list