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

            Bug ID: 16855
           Summary: llvm generates invalid mov command for arm7tdmi target
           Product: clang
           Version: 3.3
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: LLVM Codegen
          Assignee: [email protected]
          Reporter: [email protected]
                CC: [email protected]
    Classification: Unclassified

Command:
clang -target arm-softfloat-eabi -mcpu=arm7tdmi -mthumb -O2 -c -o foo.o foo.c

Contents of foo.c:
int foo(int a, int b) { return b; }

Generated assembler code (relevant part):
foo:
    mov    r0, r1
    bx    lr

Actual Result:
/tmp/foo-Kf30BB.s: Assembler messages:
/tmp/foo-Kf30BB.s:16: Error: MOV Rd, Rs with two low registers is not permitted
on this architecture -- `mov r0,r1'
clang: error: assembler (via gcc) command failed with exit code 1 (use -v to
see invocation)

Expected Result:
clang/llvm should use movs instead of mov. According to offical arm documents,
mov with two low register is not possible in thumb mode in architectures before
ARMv6. See
http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.dui0489i/Cihedhif.html

The drawback of movs is, that is resets some flags and stuff. I omit the
details of my arm-softfloat-eabi gcc/binutils toolchain since the error
detected by the assembler seems to be quite correct.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
LLVMbugs mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/llvmbugs

Reply via email to