From 82c732f97056b5a37eb2fb82963c1983d5beba7a Mon Sep 17 00:00:00 2001 From: Paul Brook Date: Tue, 4 May 2004 11:33:56 +0000 Subject: [PATCH] crti.asm: Push an even number of registers. * 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 | 5 +++++ gcc/config/arm/crti.asm | 4 ++-- gcc/config/arm/crtn.asm | 6 ++++-- 3 files changed, 11 insertions(+), 4 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 66d5ac4ee07..6d6680dc16b 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2004-05-04 Paul Brook + + * 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 * ggc-zone.c (ggc_alloc_zone_1): Add MEM_STAT_DECL parameter. diff --git a/gcc/config/arm/crti.asm b/gcc/config/arm/crti.asm index ac58e44838d..3597e42b02e 100644 --- a/gcc/config/arm/crti.asm +++ b/gcc/config/arm/crti.asm @@ -42,12 +42,12 @@ #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 diff --git a/gcc/config/arm/crtn.asm b/gcc/config/arm/crtn.asm index 9ad75e3f2aa..714060ce60d 100644 --- a/gcc/config/arm/crtn.asm +++ b/gcc/config/arm/crtn.asm @@ -43,17 +43,19 @@ # 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__ -- 2.30.2