This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Unnecessary stack alignment on SH


I've noticed the SH port has been emitting extraneous stack
adjustments before function calls, even when the stack is already
properly aligned.  Fixed with this patch.  Ok to install?

Index: gcc/ChangeLog
from  Alexandre Oliva  <aoliva@redhat.com>

	* calls.c (combine_pending_stack_adjustment_and_call): Don't
	adjust stack when unadjusted_alignment ends up as zero.

Index: gcc/calls.c
===================================================================
RCS file: /cvs/gcc/egcs/gcc/calls.c,v
retrieving revision 1.159
diff -u -p -r1.159 calls.c
--- gcc/calls.c 2000/10/07 20:53:21 1.159
+++ gcc/calls.c 2000/10/20 13:26:05
@@ -1929,7 +1929,7 @@ combine_pending_stack_adjustment_and_cal
      after the arguments are pushed.  */
   if (preferred_unit_stack_boundary > 1)
     {
-      if (unadjusted_alignment >= 0)
+      if (unadjusted_alignment > 0)
 	adjustment -= preferred_unit_stack_boundary - unadjusted_alignment;
       else
 	adjustment += unadjusted_alignment;

-- 
Alexandre Oliva   Enjoy Guarana', see http://www.ic.unicamp.br/~oliva/
Red Hat GCC Developer                  aoliva@{cygnus.com, redhat.com}
CS PhD student at IC-Unicamp        oliva@{lsd.ic.unicamp.br, gnu.org}
Free Software Evangelist    *Please* write to mailing lists, not to me

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]