Removed direct use of r7 in inline asm, which caused GCC to abort as it is used as a frame pointer. #472
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I initially reported this on mbed.org forum (http://mbed.org/forum/bugs-suggestions/topic/5112/), and was instructed to re-send it as a pull request. So, here it is.
Patch Description
I'm currently doing offline development with the mbed SDK, and noticed it fails to build under certain condition with a following error:
Culpit is the following code in rt_CMSIS.c:
Cortex-M0 LDR has a limitation that it cannot directly load value into upper register (r12), and that's why r7 is being used as a temporary register. However, that breaks GCC on debug build since GCC is also using r7 as frame pointer.
An easy fix would be to change r7 into something else in lower register, say r6. However, to avoid writing temporary register name in asm, my patch allows compiler to allocate available register.