ARM Technical Support Knowledge Articles

Diagnostic messages A1745W, A1477W and A1786W on use of SP

Applies to: RealView Development Suite (RVDS)

Answer

When assembling an instruction using SP such as:

      ADD SP, r0, #100

the RVCT 3.x and 4.0 assemblers will generate a diagnostic message, depending which architecture or processor you build for and whether assembling for ARM or Thumb.

The RVCT 3.0 SP1 assembler (building with --cpu 7) reports:

The RVCT 3.1 and later assemblers (building with --cpu 7) give clearer diagnostics like:

In RVCT 3.0 (and SP1), the assembler only gives warning on v6T2 and v7 architectures. In RVCT 3.1 and RVCT 4.0 (until build 697 - see paragraph below), the assembler gives messages about this for any architecture. The severity of the A1477W message is also set to ERROR by default.

RVCT 4.0 b697 and later assemblers only report these diagnostics when assembling with --cpu 7.

These diagnostic messages are due to changes in the ARM Architecture. Access to SP has always been limited in Thumb instructions. The recent version of ARM Architecture Reference Manual explains that the use of the SP in an ARM instruction, in any way that is not possible in the corresponding Thumb instruction, is deprecated. Hence the new deprecated warnings for ARM code above.

The warnings mean that these (ARM) instructions currently still work, but it would be a good idea to stop using them, especially in new code and in code that needs to be portable, because it is likely to disappear from the architecture in a future version. Users can ignore and/or suppress the warning/error by assembling with the "--diag_suppress" switch. We recommend users to modify their code to avoid this deprecated use of SP. For example:

      ADD r1,r0,#100
      MOV sp, r1

You will also see similar messages if you use other assembly instructions which result in unpredictable behaviour, for example, when building the following Thumb-2 instruction with --cpu 7:

      STREX r0, r6, [r0]

Article last edited on: 2009-12-30 18:24:31

Rate this article

[Bad]
|
|
[Good]
Disagree? Move your mouse over the bar and click

Did you find this article helpful? Yes No

How can we improve this article?

Link to this article
Copyright © 2011 ARM Limited. All rights reserved. External (Open), Non-Confidential