------- Comment #18 from zadeck at naturalbridge dot com 2007-07-02 02:45 ------- Subject: Re: [4.3 Regression] function with asm() does not setup stack frame
ian at airs dot com wrote: > ------- Comment #17 from ian at airs dot com 2007-07-02 01:45 ------- > Before I tackle the specific questions, let me try to explain the issue that I > see. The issue is that during a function the value of the stack pointer > register must always be at or below the local variables. An interrupt can > occur at any time. On a processor which does not use a separate interrupt > stack, the interrupt will push values on the stack and pass control to the > kernel. The stack pointer must be set such that when an interrupt pushes > values on the stack the local variables are not corrupted. Does that make > sense? My hope is that understanding how this has to work will make clear > what > must be done. > > >> 1) Do i do this for both the frame_pointer and hard_frame_pointer? >> > > I think this kind of dependency will only be relevant after the prologue has > set up the stack. Therefore, it is only necessary to consider the hard frame > pointer. > > >> 2) There is currently code in the scanning for adding the stack pointer >> for call insns. >> > > Sure, makes sense. > > >> This code marks that ref so that it is not considered when building log >> links for combine. >> > > That makes sense too. It doesn't make sense to build log links for the stack > pointer for a call instruction; there isn't going to be anything combine. > > >> a) Should I mark the stack pointer ref added for asm's this way? >> > > It's not obvious to me that asm's should have an implicit stack pointer ref. > But maybe they should, I don't know. > > If asm's should have an explicit stack pointer ref, then regarding log links > you should do whatever is simplest. asm's can not be combined anyhow. > > >> b) Should I mark the stack pointer refs put in for the mems in this way? >> > > Yes, I would think so. > > > there is an inconsistency in your answers. Because if i am only marking the hard frame pointer and this is not set up until after reload, then the questions about the log_links and combine are moot since combine runs long before reload. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=32475