[PATCH] Fixing incorrect ARM ASM generation for BMOVPCRX_CALL MI

Chris Cadwallader ccadwallader at arxan.com
Mon Mar 4 15:09:47 PST 2013


A BMOVPCRX_CALL instruction is generated by lowering a .bc with triple=arm-none-linux-[gnueabi | android] which has one operand incorrectly lowered as an immediate.

<repro>
clang -O0 -emit-llvm -target arm-none-linux-gnueabi -fPIC -c -o SimpleIndirect.arm.bc ./projects/test-suite/SingleSource/UnitTests/2006-01-29-SimpleIndirectCall.c

llc -O0 -mtriple=arm-none-linux-gnueabi -o SimpleIndirect.s ./SimpleIndirect.arm.bc

</repro>

The above produces a .s with BMOVPCRX_CALL lowered to:

        mov     lr, pc
        mov     pc, #63


which causes a segfault at runtime of the test program.

- Chris


-------------- next part --------------
A non-text attachment was scrubbed...
Name: ARMAsmprinter.patch
Type: application/octet-stream
Size: 498 bytes
Desc: ARMAsmprinter.patch
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20130304/2b669158/attachment.obj>


More information about the llvm-commits mailing list