[gambit-list] gsc -report for finding non-reachable defines

Sven Hartrumpf hartrumpf at gmx.net
Thu Aug 24 16:20:48 EDT 2017


MF, 2017-08-24 08:00:
> A better way to determine which definitions are live is to use the tree
> shaker. Use (declare (optimize-dead-definitions)) and “gsc -dg” to create a
> dependency graph file “foo.dg” and then look at all the names in the foo.dg
> file (which can also be visualized with the “dot” program). You probably
> also want to disable inlining with (declare (not inline)) if you want to
> disregard the fact that definitions can become dead if they are inlined at
> all the call sites.

Yas. That works better than -report. Which option should I use to
_avoid_ that defined constant values (like (define *opt #t)) that are never
changed are optimized away and hence will not appear in .dg?
At the moment, I use the following options:
(declare (r5rs-scheme) (block) (not constant-fold) (not inline) (optimize-dead-definitions) (standard-bindings) (extended-bindings))

Greetings
Sven



More information about the Gambit-list mailing list