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: [email protected]
        ReportedBy: [email protected]
                CC: [email protected]


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.
_______________________________________________
LLVMbugs mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/llvmbugs

Reply via email to