Steel Bank Common Lisp

optimization notes from RESTART-CASE

Reported by 3b on 2012-07-12
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
SBCL
Low
Unassigned

Bug Description

(defun a ()
  (declare (optimize speed))
  (restart-case () (c ())))

produces optimization notes on SBCL 1.0.57.55-80ad081 x86-64 linux.

; note: Allocating a value-cell at runtime for checking possibly out of extent exit via
; (GO #:TAG2). Use GO/RETURN-FROM with SAFETY 0, or declare the exit function
; DYNAMIC-EXTENT to avoid.

expected no notes, preferably performing the optimization if possible.

Doesn't produce any notes on 1.0.55.14-137b4d0 x8664.

Changed in sbcl:
status: New → Triaged
importance: Undecided → Low
James M. Lawrence (llmjjmll) wrote :

A seemingly related issue on 1.0.57.66-5783625:

(defun find-foo (seq)
  (map nil
       (lambda (x)
         (declare (optimize speed))
         (when (eq x :foo)
           (return-from find-foo t)))
       seq))

; note: Allocating a value-cell at runtime for checking possibly out of extent exit via
; (RETURN-FROM FIND-FOO T). Use GO/RETURN-FROM with SAFETY 0, or declare the exit
; function DYNAMIC-EXTENT to avoid.

MAPCAR gives no note, but APPLY #'MAPCAR does.

 status fixcommitted
 done

> (defun find-foo (seq)
> (map nil
> (lambda (x)
> (declare (optimize speed))
> (when (eq x :foo)
> (return-from find-foo t)))
> seq))
>
> ; note: Allocating a value-cell at runtime for checking possibly out of extent exit via
> ; (RETURN-FROM FIND-FOO T). Use GO/RETURN-FROM with SAFETY 0, or declare the exit
> ; function DYNAMIC-EXTENT to avoid.
>
> MAPCAR gives no note, but APPLY #'MAPCAR does.

This (probably) would be naturally addressed by any fix to #383078, or
(since this is user code) having the user themselves wrap the
RETURN-FROM in a suitable LOCALLY OPTIMIZE form.

Christophe

Changed in sbcl:
status: Triaged → Fix Committed
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