http://llvm.org/bugs/show_bug.cgi?id=11081
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: [email protected]
ReportedBy: [email protected]
CC: [email protected]
I think that aliases are miscompiled when -fPIC is used.
Here is the minimized example (llvm r140360):
----------------
; ModuleID = 'a.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"
@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 {
entry:
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@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.
_______________________________________________
LLVMbugs mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/llvmbugs