[llvm-bugs] [Bug 32514] New: Compiling a math-heavy file that uses Eigen with the '-O3 -ffast-math' causes an infinite hang

via llvm-bugs llvm-bugs at lists.llvm.org
Mon Apr 3 16:10:46 PDT 2017


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

            Bug ID: 32514
           Summary: Compiling a math-heavy file that uses Eigen with the
                    '-O3 -ffast-math' causes an infinite hang
           Product: compiler-rt
           Version: unspecified
          Hardware: PC
                OS: MacOS X
            Status: NEW
          Severity: normal
          Priority: P
         Component: compiler-rt
          Assignee: unassignedbugs at nondot.org
          Reporter: rsanchez.saez at gmail.com
                CC: llvm-bugs at lists.llvm.org

Created attachment 18215
  --> http://bugs.llvm.org/attachment.cgi?id=18215&action=edit
clang hang example

Compiling a math-heavy file that uses Eigen with the '-O3 -ffast-math' makes
the clang compiler to hang indefinitely.

The attached file shows the problem. It is a rework of: 

https://github.com/sweeneychris/TheiaSfM/blob/98d1b2c07f836a6f90046ef5e60edea4be25a94b/src/theia/sfm/pose/perspective_three_point.cc#L184

to be self-compilable. It only depends on eigen3, you can install it through
MacPorts: sudo port install eigen3.

Compile the file through

clang -O3 -ffast-math -c PnP.cpp -I/opt/local/include/eigen3

and observe clang to hang indefinitely.

Compilation using 

clang -O3 -c PnP.cpp -I/opt/local/include/eigen3

succeeds.

--$ clang --version
Apple LLVM version 8.1.0 (clang-802.0.38)
Target: x86_64-apple-darwin16.5.0
Thread model: posix
InstalledDir:
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin

-- 
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/20170403/9074d81f/attachment.html>


More information about the llvm-bugs mailing list