[LLVMbugs] [Bug 7433] New: Invalid code generated with arm-tail-calls
bugzilla-daemon at llvm.org
bugzilla-daemon at llvm.org
Sun Jun 20 23:48:22 PDT 2010
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: unassignedbugs at nondot.org
ReportedBy: rafael.espindola at gmail.com
CC: llvmbugs at cs.uiuc.edu
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.
More information about the llvm-bugs
mailing list