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: function structure


On Wed, 2004-07-07 at 17:59, ç é wrote:
> Have you heard about StackGuard?
> I'm trying to do some work similar to that, 

"Similar to StackGuard" doesn't really answer my question.  Where are
you inserting RTL, and why are you inserting it there?

> In RTL, I emitted a function call (using emit_lib_call()) before each CALL_INSN in the current RTL unit.
> But I found that my function call is emitted between the parameter evaluate instructions and the real call instruction, this ruined the parameters to be passed to the original routine. 

Yes.  It isn't safe to emit instrumentation code immediate before or
after a CALL insn, if the instrumentation code itself requires a call. 
I think that what you are trying to do is impractical.  You need to add
the instrumentation code when RTL is generated, e.g. in expand_call,
instead of waiting until after RTL generation and doing it during one of
the RTL optimization passes.  Or alternatively, add the instrumentation
code during one of the tree/gimple passes.
-- 
Jim Wilson, GNU Tools Support, http://www.SpecifixInc.com


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