IT-block ends prematurely

Technical Note 31138

Arkitekturer:

ARM

Komponent:

compiler

Uppdaterad:

2015-11-06 12:30

Introduction

IAR Embedded Workbench for ARM version 7.30 (and earlier) accepted constructions like:

[...]
asm("ITE EQ");
asm("MRSEQ R0, MSP");
asm("MRSNE R0, PSP");
[...]

The above is a bug which is corrected in IAR Embedded Workbench for ARM version 7.40.1.

The code above will generate diagnostic messages like:

Error[Ta117]: IT-block ends prematurely, or there is a label within the IT-block

Discussion

The construction above is unsafe, as in-between the asm()-statements it was possible to place ordinary C source code.

Suggested rewrite

Change the construction into a single inline assebler statement, with multiple lines.

The above construction should be rewritten to:

[...]
asm("ITE EQ \n"
"MRSEQ R0, MSP \n"
"MRSNE R0, PSP");
[...]

 

 

All product names are trademarks or registered trademarks of their respective owners.

Det här innehållet finns tyvärr inte på svenska.

Vår webbplats finns främst på vårt koncernspråk engelska, förutom det innehåll för investerare som vi är lagstadgade att kommunicera på svenska. Vi rekommenderar att du besöker vår globala webbplats på engelska för att få en bättre upplevelse.

Vi stöder inte längre Internet Explorer. För att få bästa möjliga upplevelse av iar.com rekommenderar vi att du uppgraderar till en modern webbläsare som Chrome eller Edge.