[llvm-bugs] [Bug 42047] New: -Ofast produces infinite loop

via llvm-bugs llvm-bugs at lists.llvm.org
Tue May 28 07:49:08 PDT 2019


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

            Bug ID: 42047
           Summary: -Ofast produces infinite loop
           Product: new-bugs
           Version: unspecified
          Hardware: Macintosh
                OS: MacOS X
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: new bugs
          Assignee: unassignedbugs at nondot.org
          Reporter: p.riebold at ucl.ac.uk
                CC: htmldeveloper at gmail.com, llvm-bugs at lists.llvm.org

Created attachment 22031
  --> https://bugs.llvm.org/attachment.cgi?id=22031&action=edit
Minimal file demonstrating optimiser bug ?

The attached program should list the powers of 3 less than 2^31 - 1

If compiled with 'cc -o oe oe.c' when run it works as expected however if
compiled with '-Ofast' added it seems as if the 'if ... break;' is ignored and
it enters an infinite loop.

Platform is Mojave 10.14.5, 2.5 GHz Intel Core i7 and cc version,
philip$ cc --version
Apple LLVM version 10.0.1 (clang-1001.0.46.4)
Target: x86_64-apple-darwin18.6.0
Thread model: posix
InstalledDir:
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin
philip$

I'm not a language lawyer so this may be allowed behaviour but thought I should
report it in case it isn't

Philip

-- 
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/20190528/38446c2f/attachment.html>


More information about the llvm-bugs mailing list