[LLVMbugs] [Bug 21111] New: Clang miscompiles dllimport + thread local variables

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Tue Sep 30 23:27:04 PDT 2014


            Bug ID: 21111
           Summary: Clang miscompiles dllimport + thread local variables
           Product: clang
           Version: unspecified
          Hardware: PC
                OS: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: LLVM Codegen
          Assignee: unassignedclangbugs at nondot.org
          Reporter: david.majnemer at gmail.com
                CC: llvmbugs at cs.uiuc.edu
    Classification: Unclassified

__declspec(thread, dllimport) int x;
int f() { return x; }

we generate:
"?f@@YAHXZ":                            # @"\01?f@@YAHXZ"
# BB#0:                                 # %entry
        pushl   %ebp
        movl    %esp, %ebp
        movl    __tls_index, %eax 
        movl    %fs:__tls_array, %ecx 
        movl    (%ecx,%eax,4), %eax
        movl    "?x@@3HA"@SECREL32(%eax), %eax
        popl    %ebp

Note that 'x' isn't dllimport'd

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/20141001/6cea9938/attachment.html>

More information about the llvm-bugs mailing list