show size of stack needed by functions
Eric Botcazou
ebotcazou@adacore.com
Wed Oct 13 22:43:00 GMT 2010
> Of course, the compiler can't dump the callgraph of the whole program.
> But it could dump the list of functions called by every function of a
> translation unit. With annotations which of the calls are inlined. Which
> could then be processed by a script to get the whole callgraph.
We have had something along these lines in our compiler at AdaCore for a few
years; it's called -fcallgraph-info, it generates a very low-level callgraph
in VCG format for each compilation unit, and the nodes can be decorated with
information (typically stack usage indeed). Then you run a script to "link"
all the VCG files for a program and you can (try and) compute the worst case
stack usage for example. This works reasonably well for embedded stuff.
I'll try and submit something before stage 1 ends if people are interested.
--
Eric Botcazou
More information about the Gcc
mailing list