[LLVMbugs] [Bug 16855] New: llvm generates invalid mov command for arm7tdmi target
bugzilla-daemon at llvm.org
bugzilla-daemon at llvm.org
Sat Aug 10 20:11:54 PDT 2013
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: unassignedclangbugs at nondot.org
Reporter: sven.koehler at gmail.com
CC: llvmbugs at cs.uiuc.edu
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.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20130811/f80af495/attachment.html>
More information about the llvm-bugs
mailing list