OSDN Git Service

Thu Feb 24 17:17:29 MET 2000 Jan Hubicka <jh@suse.cz>
authorhubicka <hubicka@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 28 Feb 2000 11:55:43 +0000 (11:55 +0000)
committerhubicka <hubicka@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 28 Feb 2000 11:55:43 +0000 (11:55 +0000)
* calls.c (expand_call): Attempt to combine stack adjustments with
pending stack adjustments.

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

gcc/ChangeLog
gcc/calls.c

index c064d94..9d36cce 100644 (file)
@@ -1,3 +1,8 @@
+Mon Feb 28 12:53:57 MET 2000 Jan Hubicka  <jh@suse.cz>
+
+       * calls.c (expand_call): Attempt to combine stack adjustments with
+       pending stack adjustments.
+
 Mon Feb 28 11:34:43 2000  J"orn Rennecke <amylaar@cygnus.co.uk>
 
        * loop.c (reg_in_basic_block_p): Don't abort when falling through
index 07f4c48..dfa52e0 100644 (file)
@@ -2276,8 +2276,22 @@ expand_call (exp, target, ignore)
 #ifdef PREFERRED_STACK_BOUNDARY
   /* If we push args individually in reverse order, perform stack alignment
      before the first push (the last arg).  */
-  if (argblock == 0)
-    anti_adjust_stack (GEN_INT (args_size.constant - unadjusted_args_size));
+  if (args_size.constant != unadjusted_args_size)
+    {
+      /* When the stack adjustment is pending,
+        we get better code by combining the adjustments.  */
+      if (pending_stack_adjust && !is_const)
+       {
+         args_size.constant = (unadjusted_args_size
+                               + ((pending_stack_adjust + args_size.constant
+                                   - unadjusted_args_size)
+                                  % (preferred_stack_boundary / BITS_PER_UNIT)));
+         pending_stack_adjust -= args_size.constant - unadjusted_args_size;
+         do_pending_stack_adjust ();
+       }
+      else if (argblock == 0)
+       anti_adjust_stack (GEN_INT (args_size.constant - unadjusted_args_size));
+    }
 #endif
 #endif