show size of stack needed by functions
Eric Botcazou
ebotcazou@adacore.com
Mon May 9 23:17:00 GMT 2016
> 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, there seems to be a constant mismatch (2 bytes with
> avr-gcc-5.3) between change of stack pointer and output of -fstack-usage.
> In some rare cases there are more differences, which I didn't understand
> yet.
That's a bug, very likely in the AVR back-end, which must be fixed by someone
who knows the AVR architecture.
> 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
> trivial. Or is it?
It's not difficult, but there is a conflict between them because -fstack-usage
is designed to be conservatively correct while -fdump-ipa-cgraph is not (it
does not dump the full callgraph).
--
Eric Botcazou
More information about the Gcc
mailing list