Reported by Martin Cracauer.
Fixes lp#887220.
;;;; -*- coding: utf-8; fill-column: 78 -*-
+changes relative to sbcl-1.0.53:
+ * bug fix: on 64-bit targets, atomic-incf/aref does index computation
+ correctly, even on wide-fixnum builds. (lp#887220)
+
changes in sbcl-1.0.53 relative to sbcl-1.0.52:
* enhancement: on 64-bit targets, in src/compiler/generic/early-vm.lisp,
the parameter n-fixnum-tag-bits may now vary from 1 (fixnum =
(:result-types unsigned-num)
(:generator 4
(inst xadd (make-ea :qword :base array
- :scale 1 :index index
+ :scale (ash 1 (- word-shift n-fixnum-tag-bits))
+ :index index
:disp (- (* vector-data-offset n-word-bytes)
other-pointer-lowtag))
diff :lock)
(compile nil `(lambda (x)
(declare (type character x))
(eql x #\U0010FFFF))))
+
+;; Wide fixnum platforms had buggy address computation in atomic-incf/aref
+(with-test (:name :bug-887220)
+ (let ((incfer (compile
+ nil
+ `(lambda (vector index)
+ (declare (type (simple-array sb-ext:word (4))
+ vector)
+ (type (mod 4) index))
+ (sb-ext:atomic-incf (aref vector index) 1)
+ vector))))
+ (assert (equalp (funcall incfer
+ (make-array 4 :element-type 'sb-ext:word
+ :initial-element 0)
+ 1)
+ #(0 1 0 0)))))