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: Any hints on this problem? Thanks!


On Sat, 2007-02-10 at 07:45 +0800, åæ wrote:
> Thanks for your hints. Is that means doing intrumentation at the "RTL
> expand" level? 

expand_call is a function in the calls.c file.  It knows how to do
function calls correctly.  If you use this, then registers will be saved
and restored correctly.

> However, I have tried the following method, add a
> defined_expand  in ia64.md, the template used in define_expand is the
> same as the one which will emit a ld instruction, just like this one:

A define_expand is used only for creating RTL.  This define_expand will
be used only if someplace else has "gen_gift_load_symptr_low (...);".

A define_expand is not used for matching instructions.  So if you have a
define_expand emitting some RTL, then someplace else there must be a
define_insn that matches it.

You will need to learn a lot more about gcc internals to get this
working.  It is probably simpler to just write your instrumentation
function in assembly code.  Or maybe compile it to assembly, and then
fix it by hand.
-- 
Jim Wilson, GNU Tools Support, http://www.specifix.com



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