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]

Re: PATCH: stack pointer alignment problem


  In message <200007302025.VAA29274@net.HCC.nl>you write:
  > Hello,
  > 
  > I discovered a stack pointer alignment problem on the c4x target.
  > The code:
  > 
  > tst()
  > {
  >   tst1();
  > }
  > 
  > Gets compiled as:
  > 
  > _tst:
  >         addi    1,sp
  >         call    _tst1
  >         addi    -1,sp
  >         rets
  > 
  > We do not need stack pointer alignment on the c4x target so we
  > defined STACK_BOUNDARY=32 (same as BITS_PER_UNIT=32). The call
  > to the function combine_pending_stack_adjustment_and_call resulted
  > in a stack adjustment of 1 in this case. The values stack_pointer_delta,
  > unadjusted_args_size and pending_stack_adjust are all 0.
  > This resulted in unadjusted_alignment being 0 and that results
  > in a stack pointer adjustment of 1.
  > With the patch below this is fixed. The addi 1,sp and addi -1,sp
  > are removed.
  > 
  > 	Herman.
  > 
  > 2000-06-01 Herman A.J. ten Brugge <Haj.Ten.Brugge@net.HCC.nl>
  > 
  > 	* calls.c: Only use preferred_unit_stack_boundary when it is > 1.
Thanks.  Installed.
jeff


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