callees.)
258:
- Compiler fails on
-
- (defun u-b-sra (ad0)
- (declare (special *foo* *bar*))
- (declare (optimize (safety 3) (speed 2) (space 1) (debug 1)))
- (labels ((c.frob (x)
- (random x))
- (ad.frob (ad)
- (mapcar #'c.frob ad)))
- (declare (inline c.frob ad.frob))
- (list (the list ad0)
- (funcall (if (listp ad0) #'ad.frob #'print) ad0)
- (funcall (if (listp ad0) #'ad.frob #'print) (reverse ad0)))))
+ (fixed in 0.8.1.3)
DEFUNCT CATEGORIES OF BUGS
IR1-#:
;;; functional instead.
(defun reference-leaf (start cont leaf)
(declare (type continuation start cont) (type leaf leaf))
+ (when (functional-p leaf)
+ (assure-functional-live-p leaf))
(let* ((type (lexenv-find leaf type-restrictions))
(leaf (or (and (defined-fun-p leaf)
(not (eq (defined-fun-inlinep leaf)
;;; are converting inline expansions for local functions during
;;; optimization.
(defun ir1-convert-local-combination (start cont form functional)
-
- ;; The test here is for "when LET converted", as a translation of
- ;; the old CMU CL comments into code. Unfortunately, the old CMU CL
- ;; comments aren't specific enough to tell whether the correct
- ;; translation is FUNCTIONAL-SOMEWHAT-LETLIKE-P or
- ;; FUNCTIONAL-LETLIKE-P or what. The old CMU CL code assumed that
- ;; any non-null FUNCTIONAL-KIND meant that the function "had been
- ;; LET converted", which might even be right, but seems fragile, so
- ;; we try to be pickier.
- (when (or
- ;; looks LET-converted
- (functional-somewhat-letlike-p functional)
- ;; It's possible for a LET-converted function to end up
- ;; deleted later. In that case, for the purposes of this
- ;; analysis, it is LET-converted: LET-converted functionals
- ;; are too badly trashed to expand them inline, and deleted
- ;; LET-converted functionals are even worse.
- (eql (functional-kind functional) :deleted))
- (throw 'locall-already-let-converted functional))
- ;; Any other non-NIL KIND value is a case we haven't found a
- ;; justification for, and at least some such values (e.g. :EXTERNAL
- ;; and :TOPLEVEL) seem obviously wrong.
- (aver (null (functional-kind functional)))
-
+ (assure-functional-live-p functional)
(ir1-convert-combination start
cont
form
*inline-expansion-limit*))
nil)
(t t))))
+
+;;; Make sure that FUNCTIONAL is not let-converted or deleted.
+(defun assure-functional-live-p (functional)
+ (declare (type functional functional))
+ (when (and (or
+ ;; looks LET-converted
+ (functional-somewhat-letlike-p functional)
+ ;; It's possible for a LET-converted function to end up
+ ;; deleted later. In that case, for the purposes of this
+ ;; analysis, it is LET-converted: LET-converted functionals
+ ;; are too badly trashed to expand them inline, and deleted
+ ;; LET-converted functionals are even worse.
+ (eql (functional-kind functional) :deleted)))
+ (throw 'locall-already-let-converted functional)))
\f
;;;; careful call
'((1 2 3) (7 14 21) (21 14 7))))
(delete-package :bug148)
+
+;;; bug 258
+(defpackage :bug258 (:use :cl))
+(in-package :bug258)
+
+(defun u-b-sra (ad0)
+ (declare (special *foo* *bar*))
+ (declare (optimize (safety 3) (speed 2) (space 1) (debug 1)))
+ (labels ((c.frob (x)
+ (1- x))
+ (ad.frob (ad)
+ (mapcar #'c.frob ad)))
+ (declare (inline c.frob ad.frob))
+ (list (the list ad0)
+ (funcall (if (listp ad0) #'ad.frob #'print) ad0)
+ (funcall (if (listp ad0) #'ad.frob #'print) (reverse ad0)))))
+
+(assert (equal (u-b-sra '(4 9 7))
+ '((4 9 7) (3 8 6) (6 8 3))))
+
+(delete-package :bug258)
+
\f
(sb-ext:quit :unix-status 104)