peval: don't propagate expressions that access memory
authorAndy Wingo <wingo@pobox.com>
Sat, 24 Sep 2011 16:57:59 +0000 (18:57 +0200)
committerAndy Wingo <wingo@pobox.com>
Sat, 24 Sep 2011 16:57:59 +0000 (18:57 +0200)
commit1eb4886ffa9c4c81c946af7fed8fb39020fcde12
tree11c971885cb19fab0b244d9537431209f3bf7079
parent8d06538e821c3e6cdd4861e1d8b1ec25ed930453
peval: don't propagate expressions that access memory

* module/language/tree-il/optimize.scm (peval): Rename
  `pure-expression?' to `constant-expression?', in the sense of GCC's
  `pure' and `const'.  A <toplevel-ref> is not constant, because it can
  be mutated.  A <dynref> isn't constant either, for the same reason.

* test-suite/tests/tree-il.test ("partial evaluation"): Add a test, and
  update existing tests that assumed that toplevel-ref would propagate.
module/language/tree-il/optimize.scm
test-suite/tests/tree-il.test