[LLVMbugs] [Bug 4004] New: invalid TLS with -relocation-model=pic -regalloc=local

bugzilla-daemon at cs.uiuc.edu bugzilla-daemon at cs.uiuc.edu
Sat Apr 18 14:46:18 PDT 2009


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

           Summary: invalid TLS with -relocation-model=pic -regalloc=local
           Product: tools
           Version: trunk
          Platform: PC
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: llc
        AssignedTo: rafael.espindola at gmail.com
        ReportedBy: rafael.espindola at gmail.com
                CC: llvmbugs at cs.uiuc.edu


Compiling


@a = thread_local global i32 0          ; <i32*> [#uses=2]

define void @f(i32* nocapture %c, i32* nocapture %d) nounwind optsize {
entry:
        %0 = load i32* @a, align 4              ; <i32> [#uses=1]
        store i32 %0, i32* %c, align 4
        %1 = load i32* @a, align 4              ; <i32> [#uses=1]
        store i32 %1, i32* %d, align 4
        ret void
}


with llc -relocation-model=pic -regalloc=local produces

        .byte   0x66; leaq      a at TLSGD(%rip), %rdi; .word      0x6666; rex64
        movq    %rax, -8(%rsp)
        movq    %rcx, -16(%rsp)
        call    __tls_get_addr at PLT

This is invalid. The call must be just after the rex64.

I think this is a more general problem with the local register allocator. It is
inserting spills between two instructions linked by a flag.


-- 
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