0

The __aeabi_memcpy(standard lib) function provided by arm compiler 6 use r12 as a intermediate variable.

As i know, r12 is not preserved by caller or callee.

If a caller uses r12 for some purpose before __aeabi_memcpy,then r12 will be corrupted after __aeabi_memcpy.

Is it right? Or compiler will do something to prevent?

  • Does this answer your question? [What is the usecase of Scratch Registers in ARM?](https://stackoverflow.com/questions/62840714/what-is-the-usecase-of-scratch-registers-in-arm) – Johan May 17 '22 at 10:23
  • r12 must be saved by the caller if its value needs to be preserved across the call. – rici May 18 '22 at 01:26
  • So the compiler will preserve r12? No decument describe it – Hsinyi Cheng May 26 '22 at 04:24

0 Answers0