https://bugs.llvm.org/show_bug.cgi?id=42062
Bug ID: 42062
Summary: tail call causes to run out of registers during
register allocation
Product: libraries
Version: trunk
Hardware: All
OS: All
Status: NEW
Severity: normal
Priority: P
Component: Backend: ARM
Assignee: diogo.samp...@arm.com
Reporter: diogo.samp...@arm.com
CC: llvm-bugs@lists.llvm.org, peter.sm...@linaro.org,
ties.st...@arm.com
llc in the code:
--
target triple = "thumbv8m.base-arm-none-eabi"
@foo = external global i8
declare i32 @bar(i8* nocapture, i32, i32, i8* nocapture)
define void @food(i8* %a) #0 {
entry:
%0 = tail call i32 @bar(i8* %a, i32 8, i32 1, i8* nonnull @foo)
%1 = tail call i32 @bar(i8* %a, i32 9, i32 0, i8* nonnull @foo)
%2 = tail call i32 @bar(i8* %a, i32 7, i32 2, i8* nonnull @foo)
ret void
}
attributes #0 = { minsize "target-cpu"="cortex-m23" }
--
will produce an error: ran out of registers during register allocation
running --disable-tail-calls won't
In thumb there are only 8 registers. In this particular case, the register
allocator could move the bar address, stored in r6 to register r7 and allow the
register r4, r5, r6 to be restored. But he does not.
--
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs