This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

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
  • Note: This was originally posted on 10th April 2010 at http://forums.arm.com

    Andre,

    The command line option you want to hide these is likely: "[font="Courier New"]--diag_suppress=1786,1788[/font]".

    As reported, the [font="Courier New"]STMFD[/font] is deprecated because it has [font="Courier New"]PC[/font] in the list. This may also give you issues moving between different ARM CPUs as historically the value of the offset applied to the [font="Courier New"]PC[/font] used by stores can differ.

    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]".

    hth
    s.
  • 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.