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

            Bug ID: 111494
           Summary: Signed overflow introduced by vectorizer
           Product: gcc
           Version: 14.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: tree-optimization
          Assignee: unassigned at gcc dot gnu.org
          Reporter: kristerw at gcc dot gnu.org
  Target Milestone: ---

The vectorizer changes the order of additions when vectorizing the loop below,
but it is not changing the arithmetic to be unsigned, so it introduces new
signed overflows that were not in the original program.

  int a[32];
  int foo(int n) {
    int sum = 0;
    for (int i = 0; i < n; i++)
      sum += a[i];
    return sum;
  }

Reply via email to