[LLVMbugs] [Bug 11081] New: alias is miscompiled with -fPIC

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Thu Oct 6 14:24:24 PDT 2011


           Summary: alias is miscompiled with -fPIC
           Product: new-bugs
           Version: 2.9
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: new bugs
        AssignedTo: unassignedbugs at nondot.org
        ReportedBy: kcc at google.com
                CC: llvmbugs at cs.uiuc.edu

I think that aliases are miscompiled when -fPIC is used. 
Here is the minimized example (llvm r140360): 

; ModuleID = 'a.c'
target datalayout =
target triple = "x86_64-unknown-linux-gnu"
@GLOBAL = global { i32, [60 x i8] } zeroinitializer, align 32
@ALIAS = alias internal getelementptr inbounds ({ i32, [60 x i8] }* @GLOBAL,
i32 0, i32 0)
define i32* @foo() nounwind uwtable readnone {
  ret i32* @ALIAS
$ llc -relocation-model=pic a.ll && grep ALIAS a.s

    leaq    ALIAS(%rip), %rax

The generated code should look more like 
    movq    ALIAS at GOTPCREL(%rip), %rax

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