From: Jeffrey Mark Siskind
Subject: static analysis for stack allocation
Date: 
Message-ID: <95Oct26.212329edt.179@qobi.ai.toronto.edu>
People might be interested in the following data.

The following Gabriel benchmarks do not cons:
  tak, takr

The following Gabriel benchmarks do cons but all such consing is `downward'
in the sense that allocated data is only referenced by (possibly indirect)
callees of the procedure containing the consing expression (assuming all
sound, nonexpansive in-lining of user-defined and built-in procedures):
  cpstak, ctak, destruct, fft, puzzle

The following Gabriel benchmarks do cons, and part, but not all, of such
consing is downward:
  browse, dderiv, deriv, div-iter, div-rec, fread, traverse, traverse-init

The following Gabriel benchmarks do cons but none of the consing is downward:
  fprint, takl, tprint

Downward data can be soundly consed using `alloca' and can be reclaimed without
GC and without calls to free. Such reclaimation might, of course, be
suboptimal, in the sense that downward data could become unreferencable before
the allocating procedure returns and frees the data. Nonetheless, I find it
quite surprising that of these 18 random small programs, none of which were
written (to the best of my knowledge) with stack-allocation in mind, 13 (72%)
can make use of stack allocation and 5 (28%) can make use of that strategy
exclusively.

I wonder what the percentages are among a more interesting sample set.

    Jeff (home page http://www.cs.toronto.edu/~qobi)