0.8.9.45:
[sbcl.git] / src / compiler / ir1final.lisp
index c78d83a..7fa816e 100644 (file)
@@ -20,7 +20,7 @@
 (defun note-failed-optimization (node failures)
   (declare (type combination node) (list failures))
   (unless (or (node-deleted node)
-             (not (fun-info-p (combination-kind node))))
+             (not (eq :known (combination-kind node))))
     (let ((*compiler-error-context* node))
       (dolist (failure failures)
        (let ((what (cdr failure))
         (cond ((and (cast-p dest)
                     (not (cast-type-check dest))
                     (immediately-used-p lvar node))
-               (derive-node-type node (cast-asserted-type dest)))
+               (when (values-types-equal-or-intersect
+                      (node-derived-type node)
+                      (cast-asserted-type dest))
+                 ;; FIXME: We do not perform pathwise CAST->type-error
+                 ;; conversion, and type errors can later cause
+                 ;; backend failures. On the other hand, this version
+                 ;; produces less efficient code.
+                 (derive-node-type node (cast-asserted-type dest))))
               ((and (cast-p node)
                     (eq (cast-type-check node) :external))
                (aver (basic-combination-p dest))