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: Can shrink-wrapping ever move prologue past an ASM statement?


On Wed, Jul 08, 2015 at 11:37:35AM -0500, Segher Boessenkool wrote:
> On Wed, Jul 08, 2015 at 11:22:34AM -0500, Josh Poimboeuf wrote:
> > > Writing the asm with a clobber of the stack pointer causes all stack
> > > accesses to go via the frame pointer, which causes pretty horrible
> > > code.
> > 
> > As far as I can tell, most (but not all) kernel stack accesses already
> > occur via the frame pointer anyway.  Is that bad?  Can you clarify what
> > you mean by horrible code?
> 
> If you already have a frame pointer anyway it won't get much worse,
> sure :-)
> 
> If you don't have one yet you will get one, and a stack frame, and
> all that boilerplate.  You don't want to force that if you don't
> need it.

Ah.  We're only clobbering the stack pointer when asm() has a call
instruction.  In that case we need to save and setup the frame pointer
anyway.  So I don't think it's a problem.

-- 
Josh


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