Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cortexm_common: use of r13 is deprecated #3664

Closed
miri64 opened this issue Aug 19, 2015 · 12 comments · Fixed by #3666
Closed

cortexm_common: use of r13 is deprecated #3664

miri64 opened this issue Aug 19, 2015 · 12 comments · Fixed by #3666
Assignees
Labels
Platform: ARM Platform: This PR/issue effects ARM-based platforms Type: bug The issue reports a bug / The PR fixes a bug (including spelling errors)

Comments

@miri64
Copy link
Member

miri64 commented Aug 19, 2015

Since the merge of #3333 I get the following warning:

$ BOARD=iot-lab_M3 IOTLAB_NODES=2 make -C examples/gnrc_networking/ all
make: Entering directory `/home/martine/Repositories/RIOT-OS/RIOT/examples/gnrc_networking'
Building application "gnrc_networking" for "iot-lab_M3" with MCU "stm32f1".

"make" -C /home/martine/Repositories/RIOT-OS/RIOT/boards/iot-lab_M3
"make" -C /home/martine/Repositories/RIOT-OS/RIOT/core
"make" -C /home/martine/Repositories/RIOT-OS/RIOT/cpu/stm32f1
"make" -C /home/martine/Repositories/RIOT-OS/RIOT/cpu/cortexm_common
/tmp/ccwJhJJ3.s: Assembler messages:
/tmp/ccwJhJJ3.s:211: Warning: use of r13 is deprecated
"make" -C /home/martine/Repositories/RIOT-OS/RIOT/cpu/stm32f1/periph
[…]
@miri64 miri64 added Type: bug The issue reports a bug / The PR fixes a bug (including spelling errors) Platform: ARM Platform: This PR/issue effects ARM-based platforms labels Aug 19, 2015
@miri64 miri64 added this to the Release 2015.08 milestone Aug 19, 2015
@jnohlgard
Copy link
Member

I will look into this.

@jnohlgard jnohlgard assigned jnohlgard and unassigned daniel-k Aug 19, 2015
@thomaseichinger
Copy link
Member

The line causing this is vectors_cortexm.c:137.

cmp r0, sp doesn't seem to be suspicious on first sight.

@OlegHahm
Copy link
Member

I think make scan-build was reporting this since it was introduced.

@thomaseichinger
Copy link
Member

Oops, r13 is sp. Forgot about this. 😬

@daniel-k
Copy link
Member

I found this after googling. But I couldn't find the ARM docs yet, that mention this.

@thomaseichinger
Copy link
Member

Found this too, cmp sp, r0 would be allowed.

@jnohlgard
Copy link
Member

yes, the solution is to mov r1, sp first, then cmp r0, r1

@thomaseichinger
Copy link
Member

Some register juggling. 😄

@thomaseichinger
Copy link
Member

As reference

Use of SP in ARM and Thumb instructions
You can use SP for Rn in ARM and Thumb instructions.
You can use SP for Rm in ARM instructions but this is deprecated in ARMv6T2 and above.
You can use SP for Rm in a 16-bit Thumb CMP Rn, Rm instruction but this is deprecated in ARMv6T2 and above. Other use of SP for Rm is not permitted in Thumb.

PeterKietzmann added a commit that referenced this issue Aug 20, 2015
cortexm_common: don't compare with r13/sp in assembly, fix #3664
@miri64
Copy link
Member Author

miri64 commented Aug 20, 2015

@PeterKietzmann please explain why you closed this issue.

@PeterKietzmann
Copy link
Member

It was automatically closed after I merged #3666. Isn't it fixed for you?

@miri64
Copy link
Member Author

miri64 commented Aug 20, 2015

Ah, sorry. Somehow I landed in #3356 and this wasn't merged yet.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Platform: ARM Platform: This PR/issue effects ARM-based platforms Type: bug The issue reports a bug / The PR fixes a bug (including spelling errors)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants