[llvm-bugs] [Bug 26110] New: clang c compiler produces wrong result for the attached c code with -O2 optimzation

via llvm-bugs llvm-bugs at lists.llvm.org
Mon Jan 11 06:08:50 PST 2016


https://llvm.org/bugs/show_bug.cgi?id=26110

            Bug ID: 26110
           Summary: clang c compiler produces wrong result for the
                    attached c code with -O2 optimzation
           Product: clang
           Version: 3.7
          Hardware: Macintosh
                OS: MacOS X
            Status: NEW
          Severity: release blocker
          Priority: P
         Component: LLVM Codegen
          Assignee: unassignedclangbugs at nondot.org
          Reporter: garunsrinivasan at gmail.com
                CC: llvm-bugs at lists.llvm.org
    Classification: Unclassified

Created attachment 15602
  --> https://llvm.org/bugs/attachment.cgi?id=15602&action=edit
C file that reproduces the problem

A bug in the llvm auto vectoizer produces wrong results for the attached c
file. Turning off auto vectorizer produces the right results, but makes the
bigger test cases run much slower.

Compile the attached c file with xcode 7.0x or later with (clang-700.1.81)
(based on LLVM 3.7.0svn) with the following command:


bad result:
===============================
 % clang -O2 bug.c -Wall -o bad
 % ./bad
 dbg = 10 10 10 10 10 10 10 10 

good result:
===============================
 % clang -O2 -fno-vectorize bug.c -Wall -o bad
 %./bad
 dbg = 15 15 15 15 15 15 15 15

gcc 4.7

 % gcc -O2 bug.c -Wall -o bad
 % ./bad
 dbg = 15 15 15 15 15 15 15 15

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20160111/690209aa/attachment.html>


More information about the llvm-bugs mailing list