http://llvm.org/bugs/show_bug.cgi?id=7433
Summary: Invalid code generated with arm-tail-calls
Product: libraries
Version: trunk
Platform: PC
OS/Version: Linux
Status: NEW
Severity: normal
Priority: P
Component: Backend: ARM
AssignedTo: [email protected]
ReportedBy: [email protected]
CC: [email protected]
With arm-tail-calls enabled the attached testcase is miscompiled. The diff of
the output shows what the problem is:
$ diff test-ok.s test-nok.s
75,76d74
< mov lr, pc
< bx r7
78c76,77
< ldmia sp!, {r4, r5, r6, r7, r8, pc}
---
> ldmia sp!, {r4, r5, r6, r7, r8, lr}
> bx r7 @ TAILCALL
The code is setting r7 back before branching to it. The tail call opt should be
copying the value into a caller save register.
To reproduce:
$ llc test.ll -o test-ok.s --arm-tail-calls=false
$ llc test.ll -o test-nok.s
--
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.
_______________________________________________
LLVMbugs mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/llvmbugs