X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=src%2Fcompiler%2Fseqtran.lisp;h=c956a077963c4957d836547b2670a467e5b19e55;hb=e0a4fab15834525fd043e6ef5adfd74a13af1450;hp=a3126da6b8cdffe82a680d6c2b24e77195701e4e;hpb=8cbd7fc0f27222a778ce61bae7d943a5081362cc;p=sbcl.git diff --git a/src/compiler/seqtran.lisp b/src/compiler/seqtran.lisp index a3126da..c956a07 100644 --- a/src/compiler/seqtran.lisp +++ b/src/compiler/seqtran.lisp @@ -890,10 +890,15 @@ ((<= i ,src-offset)) (declare (optimize (insert-array-bounds-checks 0))) (setf (aref ,dst (1- i)) (aref ,src (1- i)))) - `(do ((i (+ ,src-offset ,length) (1- i)) + ;; KLUDGE: The compiler is not able to derive that (+ offset + ;; length) must be a fixnum, but arrives at (unsigned-byte 29). + ;; We, however, know it must be so, as by this point the bounds + ;; have already been checked. + `(do ((i (truly-the fixnum (+ ,src-offset ,length)) (1- i)) (j (+ ,dst-offset ,length) (1- j))) ((<= i ,src-offset)) - (declare (optimize (insert-array-bounds-checks 0))) + (declare (optimize (insert-array-bounds-checks 0)) + (type (integer 0 #.sb!xc:array-dimension-limit) j i)) (setf (aref ,dst (1- j)) (aref ,src (1- i)))))) (deftransform subseq ((seq start &optional end) @@ -911,7 +916,10 @@ (sb!impl::signal-bounding-indices-bad-error seq start end)))) (let* ((size (- end start)) (result (make-array size :element-type ',element-type))) - ,(maybe-expand-copy-loop-inline 'seq 'start 'result 0 'size element-type) + ,(maybe-expand-copy-loop-inline 'seq (if (constant-lvar-p start) + (lvar-value start) + 'start) + 'result 0 'size element-type) result))))) (deftransform copy-seq ((seq) ((or (simple-unboxed-array (*)) simple-vector)) *)