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: building a basic global function call


Adam Treat wrote:
This builds just fine, but the resultant exec does not contain the function call?  What am I
missing?

You need to build a tree to represent the function call, and you need to add it to the chain of trees that represent the current function. Perhaps you are missing the second step. It is also possible that the call is getting optimized away for some reason. Use -da, and look at the rtl dumps, to see if the call is present in the first one.


There is a magic variable last_tree that represents that end of the current function, and you can add the call by appending it to last_tree. See the add_tree function, and also RECHAIN_STMTS.

It may also be useful to dump out the tree nodes to see what you have. Gcc is historically not very good at this, but there is a -fdump-translation-unit option that might be useful here.
--
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]