X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=src%2Fcompiler%2Fir1final.lisp;h=4dd2925dd62fb755c9d86d8cb92e14d2e1472473;hb=c47519c9e63fd32a635943a84ec13d8a60d95f08;hp=c78d83a49fba024337960adc6d457806c4df0d6d;hpb=61c18727668ff0c3263a3d363e609d4522d545cc;p=sbcl.git diff --git a/src/compiler/ir1final.lisp b/src/compiler/ir1final.lisp index c78d83a..4dd2925 100644 --- a/src/compiler/ir1final.lisp +++ b/src/compiler/ir1final.lisp @@ -123,7 +123,14 @@ (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))