[LLVMbugs] [Bug 10991] New: clang does not generate a @TPOFF reloc for a store to a TLS variable

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Thu Sep 22 15:45:29 PDT 2011


           Summary: clang does not generate a @TPOFF reloc for a store to
                    a TLS variable
           Product: clang
           Version: trunk
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: Driver
        AssignedTo: unassignedclangbugs at nondot.org
        ReportedBy: eugeni.stepanov at gmail.com
                CC: llvmbugs at cs.uiuc.edu

For the following code, clang generates invalid assembly (*.ll -> *.s), while
llc generated correct assembly. Details below.

; ModuleID = '1.c'
target datalayout =
target triple = "x86_64-unknown-linux-gnu"

@tls_var = thread_local global { i32, [60 x i8] } zeroinitializer, align 32

@tls_var_asanRZ = alias internal getelementptr inbounds ({ i32, [60 x i8] }*
@tls_var, i32 0, i32 0)

define i32 @main() nounwind uwtable {
  store volatile i32 1, i32* @tls_var_asanRZ, align 4
  ret i32 0

Building this with "llc 1.ll" produces the following assembly for the store

movl    $1, %fs:tls_var_asanRZ at TPOFF

Building this with "clang -S 1.ll" gives the following:

movl    $1, tls_var_asanRZ

I'm attaching complete assembler listings.

Configure bugmail: http://llvm.org/bugs/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.

More information about the llvm-bugs mailing list