[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


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

           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 =
"e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128-n8:16:32:64"
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 {
entry:
  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
instruction:

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