Re: stack overflow at compile time

=?ISO-8859-1?Q?Jan_Vorbr=FCggen?= <jvorbrueggen@mediasec.de>
28 Apr 2006 23:50:04 -0400

          From comp.compilers

Related articles
stack overflow at compile time jatin.bhateja@conexant.com (Jatin Bhateja) (2006-04-27)
Re: stack overflow at compile time NOSPAMrszeflerNOSPAM@murator.com.pl (RobertSzefler) (2006-04-27)
Re: stack overflow at compile time vb@compilers.de (Volker Barthelmann) (2006-04-27)
Re: stack overflow at compile time nitin@CoWare.com (Nitin Gupta) (2006-04-27)
Re: stack overflow at compile time henry@spsystems.net (2006-04-27)
Re: stack overflow at compile time gah@ugcs.caltech.edu (glen herrmannsfeldt) (2006-04-28)
Re: stack overflow at compile time jvorbrueggen@mediasec.de (=?ISO-8859-1?Q?Jan_Vorbr=FCggen?=) (2006-04-28)
Re: stack overflow at compile time jatin.bhateja@conexant.com (Jatin Bhateja) (2006-04-28)
Re: stack overflow at compile time emailamit@gmail.com (Amit Gupta) (2006-04-29)
Re: stack overflow at compile time bobduff@shell01.TheWorld.com (Robert A Duff) (2006-04-29)
Re: stack overflow at compile time emailamit@gmail.com (Amit Gupta) (2006-04-30)
Re: stack overflow at compile time henry@spsystems.net (2006-04-30)
Re: stack overflow at compile time henry@spsystems.net (2006-04-30)
[2 later articles]
| List of all articles for this month |

From: =?ISO-8859-1?Q?Jan_Vorbr=FCggen?= <jvorbrueggen@mediasec.de>
Newsgroups: comp.compilers
Date: 28 Apr 2006 23:50:04 -0400
Organization: MediaSec Technologies GmbH
References: 06-04-157 06-04-161
Keywords: analysis, storage
Posted-Date: 28 Apr 2006 23:50:04 EDT

> In the absence of recursion or non-trivial dynamic allocation, bounding
> stack size at compile time is obviously a straightforward problem:
> generate the call graph, label each arc with the stack size of the routine
> being called, and find the greatest "distance" from the root to a leaf.
> The maximum may occur on a path that's actually impossible, but at least
> you do get a bound.
>
> As a practical matter, you'll need either compiler-linker cooperation or a
> compiler that sees the whole program (including all libraries), but that's
> no big deal.
>
> I have a dim recollection that some commercial compiler systems for
> microcontrollers (some of which have quite small fixed-size stacks) do
> in fact do this.


The occam 2 compilers definitely did/do this. In their case, "stack" was/is
synonymous with the tranputer's "workspace". The compiler does consider
overlap properly on the call graph.


Jan



Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.