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: Status of -fstack-usage?


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 :)


 


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]