[PATCH/RFC] ARM -- Implement ATPCS stack alignment rules

Richard Earnshaw rearnsha@arm.com
Mon Nov 4 11:27:00 GMT 2002


>  > > + /* 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.



More information about the Gcc-patches mailing list