LA32 also needs two pointers to support nested functions.

gcc/ChangeLog:

        * config/loongarch/loongarch.h (STACK_BOUNDARY): Change to 128.
        (LARCH_STACK_ALIGN): Change to 16.
        (TRAMPOLINE_SIZE): Add two pointers size.
---
 gcc/config/loongarch/loongarch.h | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

diff --git a/gcc/config/loongarch/loongarch.h b/gcc/config/loongarch/loongarch.h
index b3bd3146d24..59fcf891345 100644
--- a/gcc/config/loongarch/loongarch.h
+++ b/gcc/config/loongarch/loongarch.h
@@ -663,7 +663,7 @@ enum reg_class
    `crtl->outgoing_args_size'.  */
 #define OUTGOING_REG_PARM_STACK_SPACE(FNTYPE) 1
 
-#define STACK_BOUNDARY (TARGET_ABI_LP64 ? 128 : 64)
+#define STACK_BOUNDARY 128
 
 /* This value controls how many pages we manually unroll the loop for when
    generating stack clash probes.  */
@@ -750,8 +750,7 @@ typedef struct {
 
 /* Treat LOC as a byte offset from the stack pointer and round it up
    to the next fully-aligned offset.  */
-#define LARCH_STACK_ALIGN(LOC) \
-  (TARGET_ABI_LP64 ? ROUND_UP ((LOC), 16) : ROUND_UP ((LOC), 8))
+#define LARCH_STACK_ALIGN(LOC) ROUND_UP ((LOC), 16)
 
 #define MCOUNT_NAME "_mcount"
 
@@ -781,8 +780,7 @@ typedef struct {
 
 #define TRAMPOLINE_CODE_SIZE 16
 #define TRAMPOLINE_SIZE \
-  ((Pmode == SImode) ? TRAMPOLINE_CODE_SIZE \
-                    : (TRAMPOLINE_CODE_SIZE + POINTER_SIZE * 2))
+         (TRAMPOLINE_CODE_SIZE + GET_MODE_SIZE (ptr_mode) * 2)
 #define TRAMPOLINE_ALIGNMENT POINTER_SIZE
 
 /* loongarch_trampoline_init calls this library function to flush
-- 
2.34.1

Reply via email to