crti.asm: Push an even number of registers.
authorPaul Brook <paul@codesourcery.com>
Tue, 4 May 2004 11:33:56 +0000 (11:33 +0000)
committerPaul Brook <pbrook@gcc.gnu.org>
Tue, 4 May 2004 11:33:56 +0000 (11:33 +0000)
* config/arm/crti.asm: Push an even number of registers.
* config/arm/crtn.asm: And restore them.  Load via sp.

From-SVN: r81473

gcc/ChangeLog
gcc/config/arm/crti.asm
gcc/config/arm/crtn.asm

index 66d5ac4ee0776e25fbd85794615cfbaca778b842..6d6680dc16bb6948347b87f0520d9ed1b669b201 100644 (file)
@@ -1,3 +1,8 @@
+2004-05-04  Paul Brook  <paul@codesourcery.com>
+
+       * config/arm/crti.asm: Push an even number of registers.
+       * config/arm/crtn.asm: And restore them.  Load via sp.
+
 2004-05-04  Paolo Bonzini  <bonzini@gnu.org>
 
        * ggc-zone.c (ggc_alloc_zone_1): Add MEM_STAT_DECL parameter.
index ac58e44838df7882cd14f253861a21ce315394cd..3597e42b02eb2d756a3758c1d018b55524e88a28 100644 (file)
 #ifdef __thumb__
        .thumb
        
-       push    {r4, r5, r6, r7, lr}
+       push    {r3, r4, r5, r6, r7, lr}
 #else
        .arm
        #  Create a stack frame and save any call-preserved registers
        mov     ip, sp
-       stmdb   sp!, {r4, r5, r6, r7, r8, r9, sl, fp, ip, lr, pc}
+       stmdb   sp!, {r3, r4, r5, r6, r7, r8, r9, sl, fp, ip, lr, pc}
        sub     fp, ip, #4
 #endif
 .endm
index 9ad75e3f2aabb9ca122d8569cb59a7cfee694098..714060ce60dafbdfe782cf2262a2199a75bb67b2 100644 (file)
        # sequences here, it is just not worth it.  Instead keep things
        # simple.  Restore all the save resgisters, including the link
        # register and then perform the correct function return instruction.
+       # We also save/restore r3 to ensure stack alignment.
 .macro FUNC_END
 #ifdef __thumb__
        .thumb
        
-       pop     {r4, r5, r6, r7}
+       pop     {r3, r4, r5, r6, r7}
        pop     {r3}
        mov     lr, r3
 #else
        .arm
        
-       ldmdb   fp, {r4, r5, r6, r7, r8, r9, sl, fp, sp, lr}
+       sub     sp, fp, #40
+       ldmfd   sp, {r4, r5, r6, r7, r8, r9, sl, fp, sp, lr}
 #endif
        
 #if defined __THUMB_INTERWORK__ || defined __thumb__