dynamic-extent propagation failure make-array/make-struct/list
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
SBCL |
Fix Released
|
Medium
|
Unassigned |
Bug Description
For some reason, dynamic extent fails to be propgated through the make-array/
compile-
array: 2AAAAD8C17FF struct1: 2AAAAD8C1831 struct2: 2AAAAD8C1811
struct1-a: 2AAAAD8C1857 struct2-a: 100334B657
That is: everything got DX-allocated except "(list 6)".
The make-array was dx-allocated, both make-foo were dx-allocated.
The (list 5)" allocated as part of "s" is dx-allocated.
But *not* the (list 6) through make-foo through make-array.
All the cruft in that example isn't necessary, btw, the failure happens just the same way with a "trivial-example", as below. I just added the cruft to attempt to figure out where the problem was occurring.
(declaim (optimize (safety 0) (speed 3) (debug 0)))
(declaim (inline make-foo))
(defstruct foo
a)
(defun testit ()
(let* ((s (make-foo :a (list 5)))
(result (make-array 2 :initial-contents (list s (make-foo :a (list 6))))))
(declare (dynamic-extent s result))
(locally (declare (optimize (speed 1)))
(format t "array: ~X struct1: ~X struct2: ~X struct1-a: ~X struct2-a: ~X"
(defun trivial-example ()
(let ((result (make-array 1 :initial-contents (list (make-foo :a (list 6))))))
(declare (dynamic-extent result))
(car (foo-a (elt result 0)))))
Tested with SBCL 1.0.38.12 Linux x86-64.
Changed in sbcl: | |
importance: | Undecided → Medium |
status: | New → Triaged |
Changed in sbcl: | |
assignee: | nobody → Nikodemus Siivola (nikodemus) |
status: | Triaged → In Progress |
Changed in sbcl: | |
status: | Fix Committed → Fix Released |
The problem lies in the array optimizations making LIST NOTINLINE in order to pick it apart -- which foils DX for it later on.