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

Re: Oddities in ARM (stack handling)


Hi Adrian,

> So I wonder what influences the decision whether a given function
> needs a frame pointer (the only point where frame_pointer_needed is
> set seems to be in reload1.c, and I don't understand the explanation
> there. Also I did not change that file).

The macro FRAME_POINTER_REQUIRED is also relevant.  (see arm.h)
 
> Additionally - and this is the odditiy I'm speaking of in the
> subject - the unchainged functions saves the registers with "stmfd { 
> everything..., pc }".
> 
> I wonder why to save the pc - it is never loaded, nor is the space
> reserved on the stack ever needed.

Because it creates a stack frame, as per the ARM Procedure Call
Standard.  The APCS says that frames are optional, so if the frame
pointer is not needed the stack frame is not created, but if the frame
pointer is needed then the code creates a valid stack frame.

Cheers
        Nick


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