Below code for Cortex-R5 CPU,
__irq void Foo( void )
With ARM 5.05, it compiles OK as
PUSH {r0-r12,lr} ... POP {r0-r12,lr} SUBS pc,lr,#4
With ARM 5.06, it compiles NOT OK as
PUSH {r4-r12,lr} ... POP {r4-r12,pc}
Hey!! When IRQ handler ends, the PC return address should be "lr -4 not the "lr"!
This looks to me a serious bug! Is there any patch to get this problem fixed?
Yes, unfortunately this is a known issue, see (the end of) http://infocenter.arm.com/help/topic/com.arm.doc.arn0005v/index.html
This will be fixed in the next release, ARM Compiler 5.06u1. This is expected to be released towards the end of September.