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

            Bug ID: 127310
           Summary: [17 Regression] Segfault during vectorisation of
                    mixed-sign dot-product
           Product: gcc
           Version: 17.0
            Status: UNCONFIRMED
          Keywords: aarch64-sve, ice-on-valid-code
          Severity: normal
          Priority: P3
         Component: tree-optimization
          Assignee: unassigned at gcc dot gnu.org
          Reporter: ktkachov at gcc dot gnu.org
  Target Milestone: ---
            Target: aarch64

__attribute__ ((noipa)) unsigned int
mixed_dot_induction (unsigned int n)
{
  unsigned int sum = 0;
  for (unsigned int i = 0; i < n; ++i)
    sum += (signed char) i * (unsigned char) (i * 17 + 3);
  return sum;
}

int
main (void)
{
  unsigned int expected = 0;
  for (unsigned int n = 0; n <= 1025; ++n)
    {
      if (mixed_dot_induction (n) != expected)
       __builtin_abort ();
      int x = (int) (n & 127) - (int) (n & 128);
      int y = (n * 17 + 3) & 255;
      expected += x * y;
    }
  return 0;
}

on aarch64 with -O3 -march=armv8.2-a+sve -mautovec-preference=sve-only ICEs:
during GIMPLE pass: vect
<source>: In function 'mixed_dot_induction':
<source>:2:1: internal compiler error: Segmentation fault
    2 | mixed_dot_induction (unsigned int n)
      | ^~~~~~~~~~~~~~~~~~~

Reply via email to