OSDN Git Service

* config/arm/crti.asm: Push an even number of registers.
authorpbrook <pbrook@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 4 May 2004 11:33:56 +0000 (11:33 +0000)
committerpbrook <pbrook@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 4 May 2004 11:33:56 +0000 (11:33 +0000)
* config/arm/crtn.asm: And restore them.  Load via sp.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@81473 138bc75d-0d04-0410-961f-82ee72b054a4

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

index 66d5ac4..6d6680d 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 ac58e44..3597e42 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 9ad75e3..714060c 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__