LLVM Bugzilla is read-only and represents the historical archive of all LLVM issues filled before November 26, 2021. Use github to submit LLVM bugs

Bug 630 - [llvm-gcc] Using __asm__ to rename symbols is broken on OS/X
Summary: [llvm-gcc] Using __asm__ to rename symbols is broken on OS/X
Status: RESOLVED FIXED
Alias: None
Product: tools
Classification: Unclassified
Component: llvm-gcc (show other bugs)
Version: 1.3
Hardware: Macintosh MacOS X
: P normal
Assignee: Chris Lattner
URL:
Keywords: compile-fail
Depends on:
Blocks:
 
Reported: 2005-09-24 02:23 PDT by Chris Lattner
Modified: 2010-02-22 12:50 PST (History)
2 users (show)

See Also:
Fixed By Commit(s):


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Chris Lattner 2005-09-24 02:23:23 PDT
LLVM miscompiles this:

void foo() __asm__("_foo2");
void bar() {
  foo();
}

"_" (aka USER_LABEL_PREFIX in GCC target header files) should only be added to *user* symbols, not to 
__asm__'s.  Because of this, the "foo" function should really reference "_foo2", not "__foo2".

The right way to do this is to remove the "_" prefixification from the darwin asm printer, and make the 
CFE add USER_LABEL_PREFIX to user labels (duh), but not asm labels.

-Chris