Details
-
Bug
-
Status: Fixed
-
Medium
-
Resolution: Fixed
-
Code Generation Tools
-
CODEGEN-6690
-
-
-
default
-
Description
The Thumb2 variant of memcpy is in the source file memcpy_t2.asm. The function starts with these lines ...
__TI_C$MEMCPY: .asmfunc stack_usage(0) CMP r2, #0 ; CHECK FOR n == 0
However, later in the function there is this ...
_ovr16: PUSH {r4 - r6} ; COPYING 16 BYTES OR MORE. SUBS r2, #16 ; _lp16: LDMIA r1!, {r3 - r6} ; STMIA r0!, {r3 - r6} ; SUBS r2, #16 ; BCS _lp16 ; POP {r4 - r6} ; RESTORE THE SAVED REGISTERS AND
Note the 3 registers R4, R5, R6 are pushed and popped from the stack. Therefore, the stack usage is not 0, but 12 bytes.