stack allocation failure
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
SBCL |
Fix Released
|
Medium
|
Unassigned |
Bug Description
(defun foo (a)
(let* ((l1 (blah a))
(l2 (blah a))
(foo (make-array l1 :element-type '(unsigned-byte 8)
(bar (make-array l1 :element-type '(unsigned-byte 8)
(hoge (make-array l2 :element-type '(unsigned-byte 8)
;;; this one gets a "couldn't stack allocate" note:
(piyo (make-array l2 :element-type '(unsigned-byte 8)
(declare ((mod 32752) l1)
(declare (dynamic-extent foo bar hoge piyo))
(do-
a))
Changed in sbcl: | |
status: | Triaged → In Progress |
Changed in sbcl: | |
status: | Fix Committed → Fix Released |
There are two problems here:
* If you look at the disassembly, you see that actually none of the non-zero initialized vectors are stack allocated. So we're missing notes. This is due to the transform for fill accidentally muffling them.
* The second problem is that for specialized vectors the fill transform prevents stack allocation.
...so need to make the DX code smarter about examining functions. It can be helped a bit by adding :RESULT-ARG information for bashers (and making them return the sequence), but it will need to deal with multiple refs to the vector as well -- so in addition to :RESULT-ARG we need a :DX-ARGS annoration to at least VECTOR-LENGTH.
(Though it occurs to me that maybe all args to flushable functions are actually :DX-ARGS?)