Bug 630 - [llvm-gcc] Using __asm__ to rename symbols is broken on OS/X
: [llvm-gcc] Using __asm__ to rename symbols is broken on OS/X
Status: RESOLVED FIXED
Product: tools
Classification: Unclassified
Component: llvm-gcc
: 1.3
: Macintosh MacOS X
: P normal
Assigned To: Chris Lattner
:
: compile-fail
:
:
  Show dependency treegraph
 
Reported: 2005-09-24 02:23 CDT by Chris Lattner
Modified: 2010-02-22 12:50 CST (History)
2 users (show)

See Also:


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 CDT
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