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]
Other format: [Raw text]

Re: [x86 RFC]: SSE function arguments are not properly aligned on stack


On Thu, Jun 30, 2005 at 11:26:04AM +0200, Uros Bizjak wrote:
> This problem can be solved with following patch that forces stack alignment
> correctly in case when SSE value is passed on stack:

It seems like a generic bug.  I'm testing the following.


r~


Index: function.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/function.c,v
retrieving revision 1.633
diff -u -p -d -r1.633 function.c
--- function.c	5 Jul 2005 16:19:57 -0000	1.633
+++ function.c	6 Jul 2005 19:32:57 -0000
@@ -3256,7 +3256,7 @@ locate_and_pad_parm (enum machine_mode p
 {
   tree sizetree;
   enum direction where_pad;
-  int boundary;
+  unsigned int boundary;
   int reg_parm_stack_space = 0;
   int part_size_in_regs;
 
@@ -3291,6 +3291,11 @@ locate_and_pad_parm (enum machine_mode p
   locate->where_pad = where_pad;
   locate->boundary = boundary;
 
+  /* Remember if the outgoing parameter requires extra alignment on the
+     calling function side.  */
+  if (cfun->stack_alignment_needed < boundary)
+    cfun->stack_alignment_needed = boundary;
+
 #ifdef ARGS_GROW_DOWNWARD
   locate->slot_offset.constant = -initial_offset_ptr->constant;
   if (initial_offset_ptr->var)


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