SPEED 3 seems to cause trouble with array declaration

Bug #1776091 reported by Robert Dodier on 2018-06-10
This bug affects 1 person
Affects Status Importance Assigned to Milestone

Bug Description

With the function F in a file, let's say foo.lisp, I get the following error:

* (load "/tmp/foo.lisp")
While evaluating the form starting at line 1, column 0
  of #P"/tmp/foo.lisp":

debugger invoked on a TYPE-ERROR in thread
#<THREAD "main thread" RUNNING {9D37329}>:
  The value
  is not of type
  from the function type declaration.

Here is the definition of F. If I change SPEED 3 to SPEED 2, the error goes away. (There are several warnings about undefined functions but that's expected.)

(defun f ()
  (let ((a (foo)))
    (declare (type (simple-array (complex double-float) (*)) a))
    (let* ((n (baz)) (b (bar))
           (z (make-array n :element-type '(complex double-float))))
      (declare (type (simple-array (complex double-float) (*)) b))
      (locally (declare (optimize (speed 3)))
               (loop for k from 0 below n
                     (let ((o (* (aref a k) (conjugate (aref b k)))))
                       (setf (aref z k) o)))))))

I am working with SBCL 1.4.8 on Linux (x86). SBCL 1.4.6 shows the same behavior, 1.3.13 loads foo.lisp without complaint.

`uname -a` reports:
Linux freekbox 3.13.0-44-generic #73-Ubuntu SMP Tue Dec 16 00:23:46 UTC 2014 i686 i686 i686 GNU/Linux

`*features*` reports:

Stas Boukarev (stassats) wrote :

Can't reproduce.

Changed in sbcl:
status: New → Incomplete
Robert Dodier (robert-dodier) wrote :

Thanks for looking at it. If there is some additional info I could gather that would help figure out what's going on, you can let me know.

Stas Boukarev (stassats) wrote :

It is actually x86 specific.

Changed in sbcl:
status: Incomplete → Confirmed
importance: Undecided → Medium
Stas Boukarev (stassats) wrote :


Changed in sbcl:
status: Confirmed → Fix Committed
Stas Boukarev (stassats) on 2018-06-28
Changed in sbcl:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers