From 23713958b57766536a37f22507999fb582f6f136 Mon Sep 17 00:00:00 2001 From: Taylor R Campbell Date: Thu, 10 Jan 2019 04:01:57 +0000 Subject: [PATCH] Disable constant-folding machine-dependent primitives in LIARC. These are not valid across word size changes, but LIARC does not expose compiler:cross-compiling?. --- src/compiler/base/utils.scm | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/compiler/base/utils.scm b/src/compiler/base/utils.scm index 13c54ed4a..d580de2d8 100644 --- a/src/compiler/base/utils.scm +++ b/src/compiler/base/utils.scm @@ -541,7 +541,11 @@ USA. (define (constant-foldable-primitive? operator) (and (memq operator function-primitives) - (not (and compiler:cross-compiling? + (not (and (or compiler:cross-compiling? + ;; C back end never sets COMPILER:CROSS-COMPILING? + ;; but it has a nonconstant SCHEME-OBJECT-WIDTH + ;; which serves as a proxy. + (not (number? scheme-object-width))) (memq operator machine-dependent-primitives))))) (define-integrable (side-effect-free-primitive? operator) -- 2.25.1