This is the mail archive of the gcc@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]

argument alignment stuff



At least one of the problems is this code (as far as I can tell) does
not take the known alignment of the stack into account.

If the stack has an alignment >= the needed alignment needed for the parameter,
then OFFSET_PTR will be adjusted by pad_to_arg_alignment and no further
action is necessary.

This is what I'm playing with at the moment.  It fixes the problem I was
running into, but I'm not real familiar with this particular part of the
compiler.  There may be a better place to fix this.Index: function.c
===================================================================
RCS file: /cvs/cvsfiles/devo/gcc/function.c,v
retrieving revision 1.216
diff -c -3 -p -r1.216 function.c
*** function.c	1999/11/04 07:06:14	1.216
--- function.c	1999/11/04 15:20:50

*************** pad_to_arg_alignment (offset_ptr, bounda
*** 5060,5066 ****
  
    int boundary_in_bytes = boundary / BITS_PER_UNIT;
    
!   if (boundary > PARM_BOUNDARY)
      {
        save_var = offset_ptr->var;
        save_constant = offset_ptr->constant;
--- 5087,5093 ----
  
    int boundary_in_bytes = boundary / BITS_PER_UNIT;
    
!   if (boundary > PARM_BOUNDARY && boundary > STACK_BOUNDARY)
      {
        save_var = offset_ptr->var;
        save_constant = offset_ptr->constant;
*************** pad_to_arg_alignment (offset_ptr, bounda
*** 5082,5088 ****
  	      (ARGS_SIZE_TREE (*offset_ptr),
  	       boundary / BITS_PER_UNIT);
  	  offset_ptr->constant = 0; /*?*/
!           if (boundary > PARM_BOUNDARY)
              alignment_pad->var = size_binop (MINUS_EXPR, offset_ptr->var, save_var);
  	}
        else
--- 5109,5115 ----
  	      (ARGS_SIZE_TREE (*offset_ptr),
  	       boundary / BITS_PER_UNIT);
  	  offset_ptr->constant = 0; /*?*/
!           if (boundary > PARM_BOUNDARY && boundary > STACK_BOUNDARY)
              alignment_pad->var = size_binop (MINUS_EXPR, offset_ptr->var, save_var);
  	}
        else
*************** pad_to_arg_alignment (offset_ptr, bounda
*** 5093,5099 ****
  #else
  	    CEIL_ROUND (offset_ptr->constant, boundary_in_bytes);
  #endif
!           if (boundary > PARM_BOUNDARY)
              alignment_pad->constant = offset_ptr->constant - save_constant;
          }
      }
--- 5120,5126 ----
  #else
  	    CEIL_ROUND (offset_ptr->constant, boundary_in_bytes);
  #endif
!           if (boundary > PARM_BOUNDARY && boundary > STACK_BOUNDARY)
              alignment_pad->constant = offset_ptr->constant - save_constant;
          }
      }


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