[LLVMbugs] [Bug 8717] New: LLVM MC does not know how to handle .subsection derective

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Wed Dec 1 08:46:25 PST 2010


http://llvm.org/bugs/show_bug.cgi?id=8717

           Summary: LLVM MC does not know how to handle .subsection
                    derective
           Product: new-bugs
           Version: trunk
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: new bugs
        AssignedTo: unassignedbugs at nondot.org
        ReportedBy: kaffeemonster at googlemail.com
                CC: llvmbugs at cs.uiuc.edu


After a long time testing llvm+clang again.
llvm/clang @ TOT, r120576

Given the following (silly example) code:

int foo(int a)
{
    int x;
    asm(
        "1:\n\t"
        "dec    %0\n\t"
        "jnz    2f\n\t"
        /*
         * some procesessors see jumping back as likely
         * so jump forward, then backward
         */
        ".subsection 2\n"
        "2:\n\t"
        "jmp    1b\n\t"
        ".previous"
    : "=r" (x)
    : "0" (a)
    );
    return x;
}

clang gives:
$ clang -O -c clang_sub.c
clang_sub.c:7:12: error: expected identifier in directive
        "jnz   2f\n\t"
                   ^
<inline asm>:4:14: note: instantiated into assembly here
        .subsection 2
                    ^                  
1 error generated.

Looks like the new builtin asm foo is to blame.

I tried to make a patch (attached, don't shoot me, it's just a test, i have no
clue about C++ or llvm), but it does not solve it.

Greetings
Jan

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