arm.c (arm_expand_prologue): Ensure that the stack-adjustment barrier can't be ignore...
authorRichard Earnshaw <rearnsha@arm.com>
Wed, 23 Aug 2000 15:15:21 +0000 (15:15 +0000)
committerRichard Earnshaw <rearnsha@gcc.gnu.org>
Wed, 23 Aug 2000 15:15:21 +0000 (15:15 +0000)
* 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
gcc/config/arm/arm.c

index e2940b2..3b5df62 100644 (file)
@@ -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  <eliz@is.elta.co.il>
 
        * fixinc/inclhack.def (sysv68_string): Fix the Sed script so it
index d559d00..4c7679a 100644 (file)
@@ -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