Fix longstanding bug in compilation of predicates. Expressions like
authorChris Hanson <org/chris-hanson/cph>
Thu, 10 Aug 1989 11:49:43 +0000 (11:49 +0000)
committerChris Hanson <org/chris-hanson/cph>
Thu, 10 Aug 1989 11:49:43 +0000 (11:49 +0000)
commitabdc13977e7dd70dfc4799761fa945cebcfa532e
tree953a17097e59b0d5985dcf1b98ffb7f6fd1551a9
parenta18ab1074e07c54bf83b382ef1a88cccfb92a5f5
Fix longstanding bug in compilation of predicates.  Expressions like
this

  (if (if (bar numerator)
  (foo denominator)
  (not (foo denominator)))
      numerator
      denominator)

would compile incorrectly by making both calls to `foo' have the same
continuation.  This should have been noticed as an error because the
continuation entry hooks for that continuation were attached to both
expressions: when they were combined with the call to `bar' the hooks
were used to attach the continuation to the enclosing expression --
but each side of the test was attached twice.  Error checking in the
node-attachment code would have caught this one at compile time.

The new code generates a new continuation for the call to `foo' whose
result is inverted, and then codes the `not' using a PCFG and two
constants -- all of which gets folded out later, resulting in the
desired code.
v7/src/compiler/fggen/fggen.scm