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: unassignedb...@nondot.org
          Reporter: p.rieb...@ucl.ac.uk
                CC: htmldevelo...@gmail.com, llvm-bugs@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.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to