Skip to content

Inline asm constants incorrect in CBE output #2474

@llvmbot

Description

@llvmbot
Bugzilla Link 2102
Resolution DUPLICATE
Resolved on Feb 26, 2008 17:15
Version trunk
OS Linux
Attachments LLVM Assembly Code that exhibits the problem
Reporter LLVM Bugzilla Contributor

Extended Description

The C Backend does not correctly generate inline asm that uses constants.

For example, it takes this:

%tmp1 = call i32 asm sideeffect "add $$8, $0\0A", "={ax},{dirflag},{fpsr},~{flags}"( ) nounwind ; [#uses=1]

And translates it into this:

asm volatile ("add %%8, %0\n"
:"=a"(llvm_cbe_tmp1)
:);

The 8 should be "$8" and not "%%8" in the output.

An LLVM assembly case is attached. To reproduce:

llvm-as -o test.bc test.ll
llc -march=c -f -o test.cbe.c test.bc

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugzillaIssues migrated from bugzilladuplicateResolved as duplicate

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions