[LLVMbugs] [Bug 20076] clang-cl generates incorrect code for globals without static initializers which have references to imported functions

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Wed Jun 18 11:03:17 PDT 2014


Reid Kleckner <rnk at google.com> changed:

           What    |Removed                     |Added
             Status|NEW                         |RESOLVED
         Resolution|---                         |DUPLICATE

--- Comment #1 from Reid Kleckner <rnk at google.com> ---
When you use a dllimported function in a global constant initializer, you end
up getting the address of a thunk from the import library instead of the
address of the actual function.  It's worse for globals, where you get a link
error instead.

This will be hard to fix because a GlobalValue in LLVM is a Constant, and LLVM
optimizers will try to fold it into the initializer.

*** This bug has been marked as a duplicate of bug 19955 ***

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/20140618/4a7492f3/attachment.html>

More information about the llvm-bugs mailing list