This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: code generation for arm targets
- To: vlebedev at aplio dot fr
- Subject: Re: code generation for arm targets
- From: Nick Clifton <nickc at cygnus dot com>
- Date: Wed, 22 Mar 2000 10:10:27 -0800
- CC: gcc at gcc dot gnu dot org
Hi Vadim,
: I see some strange things in code generation for arm-elf target:
:
: 28 str lr, [sp, #-4]!
:
: Take a look at line 28.
:
: The lr register is saved in the "unallocated" stack area. The stack
: pointer is updated to include local variables frame only at line
: 33.
No its not.
: Wouldn't it be safer (with respect to interrupt and signal handling)
: to update the stack pointer immiedately upon entering the function?
You missed the ! at the end of the instruction. This indicates a
pre-indexed addressing mode. In this case the instruction will
compute:
sp = sp - 4
*sp = lr
so that stack pointer is updated before (or at the same time as) the
stack slot is written to.
Cheers
Nick