OSDN Git Service

Fix function pointer tail calls in armv8-M.base
authorPablo Barrio <pablo.barrio@arm.com>
Mon, 4 Dec 2017 16:55:49 +0000 (16:55 +0000)
committerPablo Barrio <pablo.barrio@arm.com>
Mon, 4 Dec 2017 16:55:49 +0000 (16:55 +0000)
commit93356784e0e357e3f1f74d565480cc9c25ea4bc9
treecf9bae09ce0e9c8c265005c595bd3675310a9c30
parent3f2a29c060fb22c270cbfb4f6ad62b614d59ed13
Fix function pointer tail calls in armv8-M.base

Summary:
The compiler fails with the following error message:

fatal error: error in backend: ran out of registers during
register allocation

Tail call optimization for Armv8-M.base fails to meet all the required
constraints when handling calls to function pointers where the
arguments take up r0-r3. This is because the pointer to the
function to be called can only be stored in r0-r3, but these are
all occupied by arguments. This patch makes sure that tail call
optimization does not try to handle this type of calls.

Reviewers: chill, MatzeB, olista01, rengolin, efriedma

Reviewed By: olista01, efriedma

Subscribers: efriedma, aemerson, javed.absar, llvm-commits, kristof.beyls

Differential Revision: https://reviews.llvm.org/D40706

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@319664 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Target/ARM/ARMISelLowering.cpp
test/CodeGen/ARM/v8m-tail-call.ll