[LLVMbugs] [Bug 9177] New: clang gets confused with alias and asm labels
bugzilla-daemon at llvm.org
bugzilla-daemon at llvm.org
Wed Feb 9 11:16:40 PST 2011
http://llvm.org/bugs/show_bug.cgi?id=9177
Summary: clang gets confused with alias and asm labels
Product: clang
Version: trunk
Platform: PC
OS/Version: All
Status: NEW
Severity: normal
Priority: P
Component: LLVM Codegen
AssignedTo: unassignedclangbugs at nondot.org
ReportedBy: rafael.espindola at gmail.com
CC: llvmbugs at cs.uiuc.edu
Given
-------------------
int __attribute__((visibility("hidden"))) foo (void);
extern __typeof (foo) foo __asm__ ("INT_foo")
__attribute__((__visibility__("hidden"))) ;
int foo (void) {
}
extern __typeof (foo) EXT_foo __asm__("foo")
__attribute__((__alias__("INT_foo")));
--------------------
Clang will produce
---------------------------
@"\01foo" = alias i32 ()* @INT_foo
define hidden i32 @"\01INT_foo"() nounwind {
entry:
%retval = alloca i32, align 4
%0 = load i32* %retval
ret i32 %0
}
declare i32 @INT_foo()
--------------------------
Note how we have a declaration for INT_foo and a definition for "\01INT_foo".
This gets resolved by LLVM's codegen, but causes problems to LTO because the
alias foo is pointing to a declaration.
Producing
---------------------------
@"\01foo" = alias i32 ()* @"\01INT_foo"
define hidden i32 @"\01INT_foo"() nounwind {
entry:
%retval = alloca i32, align 4
%0 = load i32* %retval
ret i32 %0
}
--------------------------
would fix the problem.
--
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