This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug target/12084] 3.3.1 emitting strange stack handling code for ARM interrupts
- From: "rearnsha at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 1 Sep 2003 09:20:15 -0000
- Subject: [Bug target/12084] 3.3.1 emitting strange stack handling code for ARM interrupts
- References: <20030828011206.12084.jamesl@appliedminds.com>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
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.