http://llvm.org/bugs/show_bug.cgi?id=15758

            Bug ID: 15758
           Summary: Incorrect vectorization of a long double array by
                    packed vectors
           Product: clang
           Version: 3.2
          Hardware: Macintosh
                OS: MacOS X
            Status: NEW
          Severity: normal
          Priority: P
         Component: -New Bugs
          Assignee: [email protected]
          Reporter: [email protected]
                CC: [email protected]
    Classification: Unclassified

With loop-vectorizer is enabled by -mllvm -vectorize-loops, clang automatically
vectorizes the assignment on a long-double array (16 bytes aligned) by
assignment on 16-bytes-aligned-x86_fp80-packed vectors. Because of the
alignment mismatch between array's elements and packed elements, subsequent
access on the array produces incorrect result.

Below is the test case.
int main (void) {
  long double x[1027];

  for (int i = 0; i < 1027; i++) {
    x[i] = (long double) i;
  }

  for (int i = 0; i < 1027; i++) {
    assert (x[i] == (long double) i);
  }

  return 0;
}

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
LLVMbugs mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/llvmbugs

Reply via email to