From e04c2d6ca11eed2c675c7a6d38ce3153fd44a635 Mon Sep 17 00:00:00 2001 From: Richard Earnshaw Date: Wed, 23 Aug 2000 15:15:21 +0000 Subject: [PATCH] arm.c (arm_expand_prologue): Ensure that the stack-adjustment barrier can't be ignored by the alias analysis... * arm.c (arm_expand_prologue): Ensure that the stack-adjustment barrier can't be ignored by the alias analysis code. From-SVN: r35911 --- gcc/ChangeLog | 5 +++++ gcc/config/arm/arm.c | 15 +++++++++++++-- 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index e2940b2300e..3b5df621334 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2000-08-23 Richard Earnshaw (rearnsha@arm.com) + + * arm.c (arm_expand_prologue): Ensure that the stack-adjustment + barrier can't be ignored by the alias analysis code. + 2000-08-12 Eli Zaretskii * fixinc/inclhack.def (sysv68_string): Fix the Sed script so it diff --git a/gcc/config/arm/arm.c b/gcc/config/arm/arm.c index d559d0042a7..4c7679abb15 100644 --- a/gcc/config/arm/arm.c +++ b/gcc/config/arm/arm.c @@ -7430,8 +7430,19 @@ arm_expand_prologue () insn = emit_insn (gen_addsi3 (stack_pointer_rtx, stack_pointer_rtx, amount)); RTX_FRAME_RELATED_P (insn) = 1; - emit_insn (gen_rtx_CLOBBER (VOIDmode, - gen_rtx_MEM (BLKmode, stack_pointer_rtx))); + + /* If the frame pointer is needed, emit a special barrier that + will prevent the scheduler from moving stores to the frame + before the stack adjustment. */ + if (frame_pointer_needed) + { + rtx unspec = gen_rtx_UNSPEC (SImode, + gen_rtvec (2, stack_pointer_rtx, + hard_frame_pointer_rtx), 4); + + emit_insn (gen_rtx_CLOBBER (VOIDmode, + gen_rtx_MEM (BLKmode, unspec))); + } } /* If we are profiling, make sure no instructions are scheduled before -- 2.30.2