Comment 2 for bug 310173

Revision history for this message
Nikodemus Siivola (nikodemus) wrote :

The issue is not file-compilation vs. non-file compilation.

The issue is that MAKE-FUNCTIONAL-FROM-TOPLEVEL-LAMBDA doesn't cross-link the original lambda and the generated XEP and then set the reoptimize flag.

Exactly *why* this generates the behaviour observed is not clear to me yet, but if MAKE-FUNCTIONAL-FROM-TOPLEVEL-LAMBDA is made more isomorphic with MAKE-XEP the issue disappears.

diff --git a/src/compiler/main.lisp b/src/compiler/main.lisp
index c0c6a81..b4258f5 100644
--- a/src/compiler/main.lisp
+++ b/src/compiler/main.lisp
@@ -1115,6 +1115,8 @@ Examples:
       (when name
         (assert-global-function-definition-type name locall-fun))
       (setf (functional-entry-fun fun) locall-fun
+ (functional-entry-fun locall-fun) fun
+ (component-reanalyze component) t
             (functional-kind fun) :external
             (functional-has-external-references-p locall-fun) t
             (functional-has-external-references-p fun) t)

Fixed in my pending tree. Will likely commit after freeze despite imperfect understanding.