[Bug target/12084] 3.3.1 emitting strange stack handling code for ARM interrupts
rearnsha at gcc dot gnu dot org
gcc-bugzilla@gcc.gnu.org
Mon Sep 1 09:20:00 GMT 2003
PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=12084
rearnsha at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |RESOLVED
Resolution| |INVALID
------- Additional Comments From rearnsha at gcc dot gnu dot org 2003-09-01 09:20 -------
You are incorrect on both counts:
> 1) The stack pointer is not being reset to its original location.
Yes it is. The first ldm reloads the stack pointer with the value it when
mov ip, sp
was executed. The second ldm pops the original ip value off the stack and
restores sp to the value it had before the interrupt was taken.
> 2) One of those ldm** needs a ^ after it to restore the correct CPSR.
No. Neither of the ldm instructions restores the PC, so it must not use ^ or
it would end up accessing the user-bank register set. Instead, the final
subs (note use of condition flag) instruction restores the CPSR.
More information about the Gcc-bugs
mailing list