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: adjust_stack variants?


On Thu, 2002-06-13 at 10:38, Jan Hubicka wrote:
> > I'm working with inserting some additional instructions into the RTL
> > stream and was wondering about the adjust_stack function. It would be
> > really nice if there was an adjust_stack_after variant like the
> > emit_*_insn_after variety. I'm having to go back and insert a function
> > call into the RTL and need to adjust the stack after making that function 
> 
> Inserting call into already generated RTL is dificult, if not
> impossible.  The function calling code is keeping a lot of information
> about the context - what parts of outgoing argument area are occupied or
> what is the current (miss) alignemnt of stack.  This won't work once the
> RTL generation has moved from the call site.
That's what I was afraid of...

> 
> What exactly do you need the function for?
Instrumentation. We're modifying GCC to instrument code on the fly.
Specifically, we're instrumenting the loop entries, continues and exits.
In the case of a while loop, you have to insert the loop continue code
in the expand_end_loop call, but by that time the body of the loop has
already been emitted so you have to go back and insert the continue code
after the start label is generated which also requires that we fix the
stack after the fact. We've got a dirty hack that just adds 4 back onto
the stack pointer, but we're looking for a better way. 

Brett

> Honza
> > call. It looks like the internals of the emit_insn_After are completely
> > different from the adjust_stack function. Before I go off and start
> > writing my own, can anybody tell me if there is already a way to do this? 
> > 
> > --
> > Brett Boren
> > ECE Graduate Research Assistant
> > University of Alabama in Huntsville
> > 


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