This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH/RFC] ARM -- Implement ATPCS stack alignment rules
- From: Richard Earnshaw <rearnsha at arm dot com>
- To: Jason R Thorpe <thorpej at wasabisystems dot com>
- Cc: Richard dot Earnshaw at arm dot com, gcc-patches at gcc dot gnu dot org
- Date: Mon, 04 Nov 2002 15:38:24 +0000
- Subject: Re: [PATCH/RFC] ARM -- Implement ATPCS stack alignment rules
- Organization: ARM Ltd.
- Reply-to: Richard dot Earnshaw at arm dot com
> > > + /* Calculate the size of the stack frame, taking into account any
> > > + padding that is required to ensure stack-alignment. */
> > > +
> > > + HOST_WIDE_INT
> > > + arm_get_frame_size ()
> > > + {
> > > + int regno;
> >
> > This function needs to be rewritten to make use of
> > arm_compute_save_reg_mask and arm_compute_save_reg0_reg12_mask.
>
> Ok, let me make sure I understand this correctly; we want to simply
> use the arm_compute_save_reg_mask return value to compute the saved-regs
> space rather than computing that mask ourselves, but no other changes?
The aim is to avoid having multiple functions that have to scan the raw
information about which registers need saving and then applying further
rules about which other registers have to be saved. All that leads to
hard-to-maintain code, which of course leads to bugs...
arm_compute_saved_reg_mask will give you a bitmask of the integer
registers that need saving. You can then count the number of bits set in
the mask to find the amount of storage required for those registers.
R.