SPEED 3 seems to cause trouble with array declaration

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

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
    NIL
  is not of type
    (UNSIGNED-BYTE 5)
  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
                     do
                     (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:
```
(:ASDF3.3 :ASDF3.2 :ASDF3.1 :ASDF3 :ASDF2 :ASDF :OS-UNIX
 :NON-BASE-CHARS-EXIST-P :ASDF-UNICODE :ALIEN-CALLBACKS :ANSI-CL
 :ASH-RIGHT-VOPS :C-STACK-IS-CONTROL-STACK :COMMON-LISP :COMPARE-AND-SWAP-VOPS
 :CYCLE-COUNTER :ELF :FP-AND-PC-STANDARD-SAVE :GCC-TLS :GENCGC
 :IEEE-FLOATING-POINT :INLINE-CONSTANTS :LARGEFILE :LINKAGE-TABLE :LINUX
 :LITTLE-ENDIAN :MEMORY-BARRIER-VOPS :MULTIPLY-HIGH-VOPS :OS-PROVIDES-BLKSIZE-T
 :OS-PROVIDES-DLADDR :OS-PROVIDES-DLOPEN :OS-PROVIDES-GETPROTOBY-R
 :OS-PROVIDES-POLL :OS-PROVIDES-PUTWC :OS-PROVIDES-SUSECONDS-T
 :PACKAGE-LOCAL-NICKNAMES :RAW-INSTANCE-INIT-VOPS :RAW-SIGNED-WORD
 :RELOCATABLE-HEAP :SB-DOC :SB-EVAL :SB-FUTEX :SB-LDB :SB-PACKAGE-LOCKS
 :SB-SOURCE-LOCATIONS :SB-THREAD :SB-UNICODE :SBCL :STACK-ALLOCATABLE-CLOSURES
 :STACK-ALLOCATABLE-FIXED-OBJECTS :STACK-ALLOCATABLE-LISTS
 :STACK-ALLOCATABLE-VECTORS :STACK-GROWS-DOWNWARD-NOT-UPWARD :SYMBOL-INFO-VOPS
 :UNIX :UNWIND-TO-FRAME-AND-CALL-VOP :X86)
```

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 :

6e24026602488555b6e823bdb93839bffbdc4598

Changed in sbcl:
status: Confirmed → Fix Committed
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers