My previous project was built on STM32F051K4U7 microcontroller using the legacy Arm compiler (v5.06).For fast data operations I used general purpose registers r5 all the way up to r11 (7 in total). The project would build just fine (potentially at a cost of higher code size, but I am OK with that).However for a new project I decided to move to STM32G0 series microcontroller and use Arm Compiler v6.20.1. The compiler appears to be unhappy if I utilize more than 4 general purpose registers (r8,r9,r10,r11). It throws a warning if I try to use r7 as follows:
ArmClang: error: '-ffixed-r7' has been specified but 'r7' is used as the frame pointer for this target
I understand that the frame pointer is stored in register R11 for A32 code and register R7 for T32 code, but can/should I use it or is there a major complication if I do so? In addition, the default setting for Arm Compiler v6.2x is -fomit-frame-pointer as specified in Arm Compiler for Embedded. I enforced this through compiler command window, but no success - I get the same error as the above.
And similarly if I try to use r6:
warning: failed to find suitable register to hold base pointer; stack realignment with variable-sized stack frames will not be possible.
Is it possible to bypass this and avoid those errors/warnings or should I avoid using these registers?