Re: show size of stack needed by functions

2016-05-18 Thread Eric Botcazou
> Under which circumstances are there missing functions in the cgraph? When the RTL expander calls library routines, there are no traces of them in the IPA callgraph. -- Eric Botcazou

Re: show size of stack needed by functions

2016-05-18 Thread Sebastian
Attached is a patch with some experiments of mine. On Tue, 10 May 2016 01:17:37 +0200 Eric Botcazou wrote: > > Wishes: > > - Add stack-usage in output of -fdump-ipa-cgraph, so that you don't need to > > relate information from two input files at all. I guess this is not >

Re: show size of stack needed by functions

2016-05-10 Thread Eric Botcazou
> I'll take a look. Thanks. The stack usage reported through current_function_static_stack_size by the back-end must comprise the amount of stack from just before the call to after the stack is established. For example on i386: eric@polaris:> cat t.c int main (void) { return 0; }

Re: show size of stack needed by functions

2016-05-10 Thread Senthil Kumar Selvaraj
Eric Botcazou writes: >> Output of -fstack-usage is not accurate >> === >> >> This article mentions a "call cost": >> https://mcuoneclipse.com/2015/08/21/gnu-static-stack-usage-analysis/ >> >> I checked for myself, by looking at the change of the

Re: show size of stack needed by functions

2016-05-09 Thread Eric Botcazou
> Output of -fstack-usage is not accurate > === > > This article mentions a "call cost": > https://mcuoneclipse.com/2015/08/21/gnu-static-stack-usage-analysis/ > > I checked for myself, by looking at the change of the stackpointer with a > debugger, and, yes,

Re: show size of stack needed by functions

2016-05-09 Thread Sebastian
Hi, sorry for reopening a very old thread, it took some time until I got around to write a script that parses the output of -fdump-ipa-cgraph and -fstack-usage. I'm using gcc 5.3 currently. It's mostly what I need, I get all the information about the callgraph that I wanted to get (what's

RE: show size of stack needed by functions

2010-10-14 Thread Weddington, Eric
-Original Message- From: Eric Botcazou [mailto:ebotca...@adacore.com] Sent: Wednesday, October 13, 2010 4:43 PM To: sebastianspublicaddr...@googlemail.com Cc: gcc@gcc.gnu.org; Joe Buck Subject: Re: show size of stack needed by functions We have had something along these lines

Re: show size of stack needed by functions

2010-10-13 Thread Ian Lance Taylor
Sebastian sebastianspublicaddr...@googlemail.com writes: can gcc show the size of the stackframe of functions, so you can, given a callgraph without cycles, calculate the worst case stack size? (Assuming no use of alloca or C99 variable size arrays) Can gcc (or ld) dump a callgraph? The

Re: show size of stack needed by functions

2010-10-13 Thread H.J. Lu
On Wed, Oct 13, 2010 at 1:05 PM, Sebastian sebastianspublicaddr...@googlemail.com wrote: Hi, can gcc show the size of the stackframe of functions, so you can, given GCC 4.6.0 has -fstack-usage. -- H.J.

Re: show size of stack needed by functions

2010-10-13 Thread Sebastian
On Wed, Oct 13, 2010 H.J. Lu wrote: GCC 4.6.0 has -fstack-usage. Thanks. That's probably the reason I didn't find it in current manuals. On Wed, Oct 13, 2010 Ian Lance Taylor wrote: The mailing list gcc@gcc.gnu.org is for the development of gcc itself. This question would be more appropriate

Re: show size of stack needed by functions

2010-10-13 Thread Joe Buck
On Wed, Oct 13, 2010 at 02:43:18PM -0700, Sebastian wrote: On Wed, Oct 13, 2010 H.J. Lu wrote: gcc can not dump a callgraph. Both GNU ld and gold can dump a cross-reference table, which is not a call graph but could perhaps be used to produce a call graph. See the --cref option. --cref

Re: show size of stack needed by functions

2010-10-13 Thread Richard Guenther
On Wed, Oct 13, 2010 at 11:54 PM, Joe Buck joe.b...@synopsys.com wrote: On Wed, Oct 13, 2010 at 02:43:18PM -0700, Sebastian wrote: On Wed, Oct 13, 2010 H.J. Lu wrote: gcc can not dump a callgraph.  Both GNU ld and gold can dump a cross-reference table, which is not a call graph but could

Re: show size of stack needed by functions

2010-10-13 Thread Sebastian
Am Mittwoch, den 13.10.2010, 14:54 -0700 schrieb Joe Buck: On Wed, Oct 13, 2010 at 02:43:18PM -0700, Sebastian wrote: On Wed, Oct 13, 2010 H.J. Lu wrote: gcc can not dump a callgraph. Both GNU ld and gold can dump a cross-reference table, which is not a call graph but could perhaps be

Re: show size of stack needed by functions

2010-10-13 Thread Richard Guenther
On Wed, Oct 13, 2010 at 11:43 PM, Sebastian sebastianspublicaddr...@googlemail.com wrote: On Wed, Oct 13, 2010 H.J. Lu wrote: GCC 4.6.0 has -fstack-usage. Thanks. That's probably the reason I didn't find it in current manuals. On Wed, Oct 13, 2010 Ian Lance Taylor wrote: The mailing list

Re: show size of stack needed by functions

2010-10-13 Thread Eric Botcazou
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

Re: show size of stack needed by functions

2010-10-13 Thread Ian Lance Taylor
Sebastian sebastianspublicaddr...@googlemail.com writes: I think, the reason that the linker only gives a list of referenced symbols per file name, and not per function, is that it can't do better. I doesn't know where the code of a function starts and ends. Does it? It does, at least when

Re: show size of stack needed by functions

2010-10-13 Thread Anthony Foiani
Apologies for continuing the somewhat off-topic thread... Sebastian sebastianspublicaddr...@googlemail.com writes: Static analysis which work on source code are not ideal, either. They don't know which functions will be inlined by the compiler. I'm pretty sure that the Linux kernel developers