[llvm-bugs] [Bug 37823] New: Loop miscompile

via llvm-bugs llvm-bugs at lists.llvm.org
Sun Jun 17 00:57:40 PDT 2018


            Bug ID: 37823
           Summary: Loop miscompile
           Product: clang
           Version: 6.0
          Hardware: Macintosh
                OS: MacOS X
            Status: NEW
          Severity: normal
          Priority: P
         Component: -New Bugs
          Assignee: unassignedclangbugs at nondot.org
          Reporter: ks at claylabs.com
                CC: llvm-bugs at lists.llvm.org

Created attachment 20434
  --> https://bugs.llvm.org/attachment.cgi?id=20434&action=edit
Program to trigger bug in Clang

I've attached a relatively simple program that triggers a miscompile. The
program logic should be straight-forward. I'm fairly certain there is no
undefined behavior.

When compiling with -O2 or -O3, the wrong output is produced. The generated
program also triggers an error with valgrind.

When compiling the attached program with -O0, the correct output is produced,
and there are no errors with valgrind.

I've tested with LLVM 6.0 and also with Xcode 9.4.1. The OS is High Sierra.

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/20180617/dfd40bdc/attachment-0001.html>

More information about the llvm-bugs mailing list