[LLVMbugs] [Bug 5623] New: LTO fails with inline asm labels referenced in C

bugzilla-daemon at cs.uiuc.edu bugzilla-daemon at cs.uiuc.edu
Thu Nov 26 21:31:10 PST 2009


           Summary: LTO fails with inline asm labels referenced in C
           Product: tools
           Version: trunk
          Platform: PC
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: lto
        AssignedTo: unassignedbugs at nondot.org
        ReportedBy: lessen42 at gmail.com
                CC: llvmbugs at cs.uiuc.edu

This is a bit ugly, but it's used in ffmpeg to create a jump table. Clang and
llvm-gcc work at -O3 but fail with -O4 on OS X, both the versions in XCode
3.2.1 and r89800. Adding .globl doesn't help. Remove the _ prefix for Linux; I
didn't test there because I can't get gold compiled.

#include <stdio.h>

extern void ff_mlp_firorder_8;

static const void *firtable[1] = {&ff_mlp_firorder_8};

int main()
    int x = 1;

    asm volatile(
        "jmp *%1 \n\t"
        "xor %0, %0 \n\t"
//        ".globl _ff_mlp_firorder_8 \n\t"
        "_ff_mlp_firorder_8: \n\t"
        "add $1, %0 \n\t"
        : "+r"(x)
        : "g"(firtable[0])
    printf("x = %d\n", x);

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