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

            Bug ID: 34645
           Summary: Possible bug: LTO, LLVM 5.0.0, mac OS: certain calls
                    get shadowed by functions from system library given
                    -flto flag provided and do not otherwise
           Product: libraries
           Version: 5.0
          Hardware: Macintosh
                OS: MacOS X
            Status: NEW
          Severity: normal
          Priority: P
         Component: Linker
          Assignee: unassignedb...@nondot.org
          Reporter: s.pankev...@gmail.com
                CC: llvm-bugs@lists.llvm.org

Created attachment 19166
  --> https://bugs.llvm.org/attachment.cgi?id=19166&action=edit
Minimal reproducible example

Please find the following minimal reproducible example in the attached:

This project is a very simplified setup extracted from openlibm library:

High quality system independent, portable, open source libm implementation
http://www.openlibm.org

This repo has a function acos, certain calls to which seem to get shadowed by
acos function from the standard library given the -flto flag is added. What is
weird that there is no symmetry between compilation with and without -flto
flag: only certain calls are shadowed while the rest still go through the
custom acos function. For a contrast another function custom_acos is added - it
is always called consistently with or without -flto flag (no shadowing occurs).

Important observation: valid inputs for acos function from the standard library
are within range [-1, 1], for all other inputs it produces nan. In the logs for
-flto below the calls of this function with invalid inputs like nan, -1.1, 1.1
do not get shadowed!

This issue is likely to affect all of the functions from openlibm library which
interfere with the their corresponding functions from math.h.

The code is also pushed here:
https://github.com/stanislaw/Examples/tree/20170916-llvm500-possible-lto-bug.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to