This is the mail archive of the 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]
Other format: [Raw text]

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

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


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