Skip to content
Snippets Groups Projects
Commit b6353a20 authored by rtoy's avatar rtoy
Browse files

Lynn Quam on cmucl-imp on 2004-03-30 says

(defun foo (f d)
  (declare (type (simple-array single-float (*)) f)
           (type (simple-array double-float (*)) d))
  (setf (aref f 0) (aref d 0)))

doesn't produce any warnings and generates completely bogus code.

Don't know what the real answer solution is, but turning off the
assert-continuation-type for a single-use continuation fixes this,
which is what 18a used to do.  There are probably other bugs that this
hides.
parent 70cf5703
No related branches found
No related tags found
No related merge requests found
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
;;; Carnegie Mellon University, and has been placed in the public domain. ;;; Carnegie Mellon University, and has been placed in the public domain.
;;; ;;;
(ext:file-comment (ext:file-comment
"$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/compiler/array-tran.lisp,v 1.34 2003/07/01 09:38:07 gerd Exp $") "$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/compiler/array-tran.lisp,v 1.35 2004/04/01 17:52:30 rtoy Exp $")
;;; ;;;
;;; ********************************************************************** ;;; **********************************************************************
;;; ;;;
...@@ -85,6 +85,20 @@ ...@@ -85,6 +85,20 @@
(defoptimizer (aref derive-type) ((array &rest indices) node) (defoptimizer (aref derive-type) ((array &rest indices) node)
(assert-array-rank array (length indices)) (assert-array-rank array (length indices))
;; If the node continuation has a single use then assert its type. ;; If the node continuation has a single use then assert its type.
;;
;; Let's not do this. As reported by Lynn Quam on cmucl-imp on
;; 2004-03-30, the compiler generates bogus code for
;;
;; (defun foo (f d)
;; (declare (type (simple-array single-float (*)) f)
;; (type (simple-array double-float (*)) d))
;; (setf (aref f 0) (aref d 0)))
;;
;; and doesn't even warn about the type mismatch. This might be a
;; symptom of other compiler bugs, but removing this at least gives
;; us back the warning. I (RLT) do not know what impact removing
;; this has on other user code.
#+(or)
(let ((cont (node-cont node))) (let ((cont (node-cont node)))
(when (= (length (find-uses cont)) 1) (when (= (length (find-uses cont)) 1)
(assert-continuation-type cont (extract-upgraded-element-type array)))) (assert-continuation-type cont (extract-upgraded-element-type array))))
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment