This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Status of -fstack-usage?
- From: Olivier Hainque <hainque at adacore dot com>
- To: Bernd Trog <berndtrog at yahoo dot com>
- Cc: gcc at gcc dot gnu dot org, hainque at adacore dot com
- Date: Wed, 18 Jan 2006 09:47:32 +0100
- Subject: Re: Status of -fstack-usage?
- References: <20060117190914.25868.qmail@web51810.mail.yahoo.com>
Bernd Trog wrote:
> By "real" I ment the actual stack usage (which is -Ox dependent) and by
> "worst case" I ment by looking simply at the code before any optimization.
>
> The actual stack usage would be most interesting, of course.
Of course, and is actually what -fstack-usage will report. I had really
misinterpreted the difference you made.
The reported stack usage is still a "worst case" from a run-time
perspective. For instance if the static allocation in a function goes
like
allocate 256 in the prologue
... some code
allocate 256 for whatnot reason (push arg, static alloca, ...)
...
the reported stack usage is 512 eventhough only 256 are actually
allocated at some points.
Hope this clarifies :)