Deprecated Warnings

Note: This was originally posted on 9th April 2010 at http://forums.arm.com

Hello,

I am just off university and fairly new to ARMs but not to microcontrolers and assembly.

I was instructed to take out all error and warning from a big code that is migrating plataforms.

I was able to take out all of the assembly warnings but of these commands:

1.stmfd sp!, {r4, r11, r12, lr, pc} 
2.sub sp, r11, #16
3.ldmfd sp, {r4, r11, sp, lr}

Which gives the respective warnings:

1. warning: A1788W: Explicit use of PC in this instruction is deprecated
2. warning: A1786W: This instruction using SP is deprecated
3. warning: A1786W: This instruction using SP is deprecated

I am using uVision3 V3.80, with RTX.

Does anyone know what are the commands that surpressed this deprecated ones or how can i take this warnings away?!
Or the document i may find this answers, i been searching infocenter for few days tring to find it but nada.

Appreciate,

Andre
Parents
  • Note: This was originally posted on 12th April 2010 at http://forums.arm.com

    Assuming you are using ARM code and not Thumb, I'm not sure what the issue is with "[font="Courier New"]SUB SP, r11, #16[/font]".


    The M-profile of the ARM architecture starts to manage the stack pointer in hardware when an exception is thrown, meaning that the stack pointer must always be valid (because of non-maskable interrupts) whereas older code could suppress interrupts and built the stack pointer value incrementally.

    I think the purpose of these deprecation warnings is to try and discourage people assembling a value on the stack in multiple stages, although why the warnings appear on non-M profile cores, I'm not entirely sure.

    If you change the code to build the SP value in another register and then perform a "MOV sp, rX" to update the SP then you will suppress the warning, although it does take another cycle and an extra register.
Reply
  • Note: This was originally posted on 12th April 2010 at http://forums.arm.com

    Assuming you are using ARM code and not Thumb, I'm not sure what the issue is with "[font="Courier New"]SUB SP, r11, #16[/font]".


    The M-profile of the ARM architecture starts to manage the stack pointer in hardware when an exception is thrown, meaning that the stack pointer must always be valid (because of non-maskable interrupts) whereas older code could suppress interrupts and built the stack pointer value incrementally.

    I think the purpose of these deprecation warnings is to try and discourage people assembling a value on the stack in multiple stages, although why the warnings appear on non-M profile cores, I'm not entirely sure.

    If you change the code to build the SP value in another register and then perform a "MOV sp, rX" to update the SP then you will suppress the warning, although it does take another cycle and an extra register.
Children
No data
More questions in this forum