[Openmcl-devel] 1.10-dev-r16180M-trunk, arm6, bug in optimizations of array-access?

Ralf Stoye stoye at stoye.com
Sun Aug 31 06:49:58 PDT 2014


Hi,

trying to use Hunchentoot on  a raspberry pi reveals a bug in the encoding in flexi-streams, caused by declarations/optimizations:


(flex:string-to-octets "Hallo" :external-format (flex:make-external-format :latin1 :eol-style :lf))
ccl Version 1.10-dev-r16180M-trunk  (LinuxARM32):
fails => #(199 199 199 199 199) , should be: #(72 97 108 108 111)
ccl Version 1.9-r16181M  (LinuxARM32):
works => #(72 97 108 108 111)

after removing some declarations in flexi streams encoding it works as expected:

--- ../dists/quicklisp/software/flexi-streams-1.0.13/encode.lisp	2014-08-31 11:45:34.090477694 +0000
+++ flexi-streams-1.0.13/encode.lisp	2014-08-31 11:50:08.835468242 +0000
@@ -69,7 +69,8 @@
            (loop for i of-type fixnum from start below end do
                  (macrolet ((octet-writer (form)
                               `(progn
-                                 (setf (aref (the (array octet *) octets) j) ,form)
+				 (setf (aref octets j) ,form)
+				 ;;(format *standard-output* "~%after setf aref ~a i ~a with ~a" octets j ,form)
                                  (incf j))))
                    (symbol-macrolet ((char-getter (char string i)))
                      (progn , at body))))
@@ -89,7 +90,8 @@
                   (underlying-stream (flexi-stream-stream stream)))
              (declare (fixnum buffer-pos buffer-size)
                       (boolean octet-seen-p)
-                      (type (array octet *) buffer))
+                      ;(type (array octet *) buffer)
+		      )
              (macrolet ((octet-writer (form)
                           `(write-octet ,form)))
                (labels ((flush-buffer ()
@@ -98,7 +100,7 @@
                           (setq buffer-pos 0))
                         (write-octet (octet)
                           "Adds one octet to the buffer and flushes it if necessary."
-                          (declare (type octet octet))
+                          ;(declare (type octet octet))
                           (when (>= buffer-pos buffer-size)
                             (flush-buffer))
                           (setf (aref buffer buffer-pos) octet)

About CCL installation:
svn co http://svn.clozure.com/publicsvn/openmcl/trunk/linuxarm/ccl
cd lisp-kernel/linuxarm/
$ $EDITOR float_abi.mk # Change to hard float
$ make clean
$ make
;; start ccl -n , then (ccl:rebuild-ccl :full t) and start again.
(ccl Version 1.10-dev-r16180M-trunk  (LinuxARM32)








More information about the Openmcl-devel mailing list