diff --git a/racket/src/cs/compile-file.ss b/racket/src/cs/compile-file.ss index e0cae03187..bb0bb0d2ec 100644 --- a/racket/src/cs/compile-file.ss +++ b/racket/src/cs/compile-file.ss @@ -2,12 +2,15 @@ ;; Check to make we're using a build of Chez Scheme ;; that has all the features we need. -(define (check-defined expr) - (unless (guard (x [else #f]) (eval expr)) +(define (check-ok what thunk) + (unless (guard (x [else #f]) (thunk)) (error 'compile-file (format "failed trying `~a`; probably you need a newer Chez Scheme" - expr)))) + what)))) + +(define (check-defined expr) + (check-ok expr (lambda () (eval expr)))) (check-defined 'box-cas!) (check-defined 'make-arity-wrapper-procedure) @@ -19,6 +22,16 @@ (check-defined '(define-ftype T (function __collect_safe () void))) (check-defined 'call-setting-continuation-attachment) (check-defined 'hashtable-cells) +(check-ok "fxvector-set!" + (lambda () + (parameterize ([optimize-level 3] + [run-cp0 (lambda (cp0 x) x)]) + + (eval '(define (op x) + (if (fx- 0) 0 0))) + (eval '(define (f x) + (fxvector-set! x 0 (op 0)))) + (eval '(f (fxvector 0)))))) ;; ---------------------------------------- diff --git a/racket/src/io/common/fixnum.rkt b/racket/src/io/common/fixnum.rkt index 187f967f4a..8c6178318f 100644 --- a/racket/src/io/common/fixnum.rkt +++ b/racket/src/io/common/fixnum.rkt @@ -7,7 +7,6 @@ ;; Representing a mutable, fixnum-valued variable with an fxvector can ;; avoid a write barrier on assignment -#; (define-syntax-rule (define-fixnum id v) (begin (define cell (fxvector v)) @@ -18,8 +17,3 @@ [(set! _ r) #'(fxvector-set! cell 0 r)] [(... (_ ...)) (raise-syntax-error stx "bad use" stx)] [_ #'(fxvector-ref cell 0)])))))) - -;; ... but, for now, something seems to go wrong with whole-program -;; optimization -(define-syntax-rule (define-fixnum id v) - (define id v))