From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nick Clifton To: vlebedev@aplio.fr Cc: gcc@gcc.gnu.org Subject: Re: code generation for arm targets Date: Wed, 22 Mar 2000 10:11:00 -0000 Message-id: <200003221810.KAA13226@elmo.cygnus.com> X-SW-Source: 2000-03/msg00570.html 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