This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: PATCH: stack pointer alignment problem
- To: Herman ten Brugge <Haj dot Ten dot Brugge at net dot HCC dot nl>
- Subject: Re: PATCH: stack pointer alignment problem
- From: Jeffrey A Law <law at cygnus dot com>
- Date: Mon, 31 Jul 2000 08:05:25 -0600
- cc: gcc-patches at gcc dot gnu dot org
- Reply-To: law at cygnus dot com
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