From 3d2929a8f013c3a35ea4fcf46426031cbb8b0953 Mon Sep 17 00:00:00 2001 From: William Harold Newman Date: Fri, 31 Dec 2004 13:39:08 +0000 Subject: [PATCH] 0.8.18.7: more BUGS misc. fiddling/tidying while trying to relearn IRn guts... ...indentation systematization ...redid printers s/#/#/ so that they look less like *PRINT-CIRCLE* bugs --- BUGS | 62 ++++++++++++++++++++++++++++++++++++ src/compiler/node.lisp | 86 ++++++++++++++++++++++++++------------------------ version.lisp-expr | 2 +- 3 files changed, 107 insertions(+), 43 deletions(-) diff --git a/BUGS b/BUGS index 8e27217e7..49b4c2566 100644 --- a/BUGS +++ b/BUGS @@ -1994,3 +1994,65 @@ WORKAROUND: we end up with a segfault. bug 367b: Comment out the (DECLAIM (FTYPE ... R367)), and compile the file. The compiler fails with TYPE-ERROR at compile time. + +368: miscompiled OR (perhaps related to bug 367) + Trying to relax type declarations to find a workaround for bug 367, + it turns out that even when the return type isn't declared (or + declared to be T, anyway) the system remains confused about type + inference in code similar to that for bug 367: + (in-package :cl-user) + (declaim (optimize (safety 3) (debug 2) (speed 2) (space 1))) + (defstruct e368) + (defstruct i368) + (defstruct g368 + (i368s (make-array 0 :fill-pointer t) :type (or (vector i368) null))) + (defstruct s368 + (g368 (error "missing :G368") :type g368 :read-only t)) + (declaim (ftype (function (fixnum (vector i368) e368) t) r368)) + (declaim (ftype (function (fixnum (vector e368)) t) h368)) + (defparameter *h368-was-called-p* nil) + (defun nsu (vertices e368) + (let ((i368s (g368-i368s (make-g368)))) + (let ((fuis (r368 0 i368s e368))) + (format t "~&FUIS=~S~%" fuis) + (or fuis (h368 0 i368s))))) + (defun r368 (w x y) + (declare (ignore w x y)) + nil) + (defun h368 (w x) + (declare (ignore w x)) + (setf *h368-was-called-p* t) + (make-s368 :g368 (make-g368))) + (trace r368 h368) + (format t "~&calling NSU~%") + (let ((nsu (nsu #() (make-e368)))) + (format t "~&NSU returned ~S~%" nsu) + (format t "~&*H368-WAS-CALLED-P*=~S~%" *h368-was-called-p*) + (assert (s368-p nsu)) + (assert *h368-was-called-p*)) + In sbcl-0.8.18, both ASSERTs fail, and (DISASSEMBLE 'NSU) shows + that no call to H368 is compiled. + +369: unlike-an-intersection behavior of VALUES-TYPE-INTERSECTION + In sbcl-0.8.18.2, the identity $(x \cap y \cap y)=(x \cap y)$ + does not hold for VALUES-TYPE-INTERSECTION, even for types which + can be intersected exactly, so that ASSERTs fail in this test case: + (in-package :cl-user) + (let ((types (mapcar #'sb-c::values-specifier-type + '((values (vector package) &optional) + (values (vector package) &rest t) + (values (vector hash-table) &rest t) + (values (vector hash-table) &optional) + (values t &optional) + (values t &rest t) + (values nil &optional) + (values nil &rest t) + (values sequence &optional) + (values sequence &rest t) + (values list &optional) + (values list &rest t))))) + (dolist (x types) + (dolist (y types) + (let ((i (sb-c::values-type-intersection x y))) + (assert (sb-c::type= i (sb-c::values-type-intersection i x))) + (assert (sb-c::type= i (sb-c::values-type-intersection i y))))))) diff --git a/src/compiler/node.lisp b/src/compiler/node.lisp index 392bea63a..c885f7f9b 100644 --- a/src/compiler/node.lisp +++ b/src/compiler/node.lisp @@ -53,7 +53,7 @@ (def!method print-object ((x ctran) stream) (print-unreadable-object (x stream :type t :identity t) - (format stream " #~D" (cont-num x)))) + (format stream "~D" (cont-num x)))) ;;; Linear VARiable. Multiple-value (possibly of unknown number) ;;; temporal storage. @@ -83,10 +83,10 @@ (def!method print-object ((x lvar) stream) (print-unreadable-object (x stream :type t :identity t) - (format stream " #~D" (cont-num x)))) + (format stream "~D" (cont-num x)))) (def!struct (node (:constructor nil) - (:copier nil)) + (:copier nil)) ;; unique ID for debugging #!+sb-show (id (new-object-id) :read-only t) ;; True if this node needs to be optimized. This is set to true @@ -137,9 +137,9 @@ (tail-p nil :type boolean)) (def!struct (valued-node (:conc-name node-) - (:include node) - (:constructor nil) - (:copier nil)) + (:include node) + (:constructor nil) + (:copier nil)) ;; the bottom-up derived type for this node. (derived-type *wild-type* :type ctype) ;; Lvar, receiving the values, produced by this node. May be NIL if @@ -192,10 +192,10 @@ ;;; numbering in the debug-info (though that is relative to the start ;;; of the function.) (def!struct (cblock (:include sset-element) - (:constructor make-block (start)) - (:constructor make-block-key) - (:conc-name block-) - (:predicate block-p)) + (:constructor make-block (start)) + (:constructor make-block-key) + (:conc-name block-) + (:predicate block-p)) ;; a list of all the blocks that are predecessors/successors of this ;; block. In well-formed IR1, most blocks will have one successor. ;; The only exceptions are: @@ -260,7 +260,7 @@ ;;; different BLOCK-INFO annotation structures so that code ;;; (specifically control analysis) can be shared. (def!struct (block-annotation (:constructor nil) - (:copier nil)) + (:copier nil)) ;; The IR1 block that this block is in the INFO for. (block (missing-arg) :type cblock) ;; the next and previous block in emission order (not DFO). This @@ -534,9 +534,11 @@ ;;; non-local exits. This is effectively an annotation on the ;;; continuation, although it is accessed by searching in the ;;; PHYSENV-NLX-INFO. -(def!struct (nlx-info (:constructor make-nlx-info - (cleanup exit &aux (lvar (node-lvar exit)))) - (:make-load-form-fun ignore-it)) +(def!struct (nlx-info + (:constructor make-nlx-info (cleanup + exit + &aux (lvar (node-lvar exit)))) + (:make-load-form-fun ignore-it)) ;; the cleanup associated with this exit. In a catch or ;; unwind-protect, this is the :CATCH or :UNWIND-PROTECT cleanup, ;; and not the cleanup for the escape block. The CLEANUP-KIND of @@ -1118,12 +1120,12 @@ ;;; initially (and forever) NIL, since REFs don't receive any values ;;; and don't have any IR1 optimizer. (def!struct (ref (:include valued-node (reoptimize nil)) - (:constructor make-ref - (leaf - &aux (leaf-type (leaf-type leaf)) - (derived-type - (make-single-value-type leaf-type)))) - (:copier nil)) + (:constructor make-ref + (leaf + &aux (leaf-type (leaf-type leaf)) + (derived-type + (make-single-value-type leaf-type)))) + (:copier nil)) ;; The leaf referenced. (leaf nil :type leaf)) (defprinter (ref :identity t) @@ -1132,10 +1134,10 @@ ;;; Naturally, the IF node always appears at the end of a block. (def!struct (cif (:include node) - (:conc-name if-) - (:predicate if-p) - (:constructor make-if) - (:copier copy-if)) + (:conc-name if-) + (:predicate if-p) + (:constructor make-if) + (:copier copy-if)) ;; LVAR for the predicate (test (missing-arg) :type lvar) ;; the blocks that we execute next in true and false case, @@ -1150,10 +1152,10 @@ (def!struct (cset (:include valued-node (derived-type (make-single-value-type *universal-type*))) - (:conc-name set-) - (:predicate set-p) - (:constructor make-set) - (:copier copy-set)) + (:conc-name set-) + (:predicate set-p) + (:constructor make-set) + (:copier copy-set)) ;; descriptor for the variable set (var (missing-arg) :type basic-var) ;; LVAR for the value form @@ -1167,8 +1169,8 @@ ;;; node appears at the end of its block and the body of the called ;;; function appears as the successor; the NODE-LVAR is null. (def!struct (basic-combination (:include valued-node) - (:constructor nil) - (:copier nil)) + (:constructor nil) + (:copier nil)) ;; LVAR for the function (fun (missing-arg) :type lvar) ;; list of LVARs for the args. In a local call, an argument lvar may @@ -1194,8 +1196,8 @@ ;;; including FUNCALL. This is distinct from BASIC-COMBINATION so that ;;; an MV-COMBINATION isn't COMBINATION-P. (def!struct (combination (:include basic-combination) - (:constructor make-combination (fun)) - (:copier nil))) + (:constructor make-combination (fun)) + (:copier nil))) (defprinter (combination :identity t) #!+sb-show id (fun :prin1 (lvar-uses fun)) @@ -1209,8 +1211,8 @@ ;;; FUNCALL. This is used to implement all the multiple-value ;;; receiving forms. (def!struct (mv-combination (:include basic-combination) - (:constructor make-mv-combination (fun)) - (:copier nil))) + (:constructor make-mv-combination (fun)) + (:copier nil))) (defprinter (mv-combination) (fun :prin1 (lvar-uses fun)) (args :prin1 (mapcar #'lvar-uses args))) @@ -1218,7 +1220,7 @@ ;;; The BIND node marks the beginning of a lambda body and represents ;;; the creation and initialization of the variables. (def!struct (bind (:include node) - (:copier nil)) + (:copier nil)) ;; the lambda we are binding variables for. Null when we are ;; creating the LAMBDA during IR1 translation. (lambda nil :type (or clambda null))) @@ -1230,10 +1232,10 @@ ;;; is also where we stick information used for TAIL-SET type ;;; inference. (def!struct (creturn (:include node) - (:conc-name return-) - (:predicate return-p) - (:constructor make-return) - (:copier copy-return)) + (:conc-name return-) + (:predicate return-p) + (:constructor make-return) + (:copier copy-return)) ;; the lambda we are returning from. Null temporarily during ;; ir1tran. (lambda nil :type (or clambda null)) @@ -1252,7 +1254,7 @@ ;;; TYPE-TO-CHECK is performed and then the VALUE is declared to be of ;;; type ASSERTED-TYPE. (def!struct (cast (:include valued-node) - (:constructor %make-cast)) + (:constructor %make-cast)) (asserted-type (missing-arg) :type ctype) (type-to-check (missing-arg) :type ctype) ;; an indication of what we have proven about how this type @@ -1284,7 +1286,7 @@ ;;; lexical exit. It is the mess-up node for the corresponding :ENTRY ;;; cleanup. (def!struct (entry (:include node) - (:copier nil)) + (:copier nil)) ;; All of the EXIT nodes for potential non-local exits to this point. (exits nil :type list) ;; The cleanup for this entry. NULL only temporarily. @@ -1300,7 +1302,7 @@ ;;; lvar is the exit node's LVAR; physenv analysis also makes it the ;;; lvar of %NLX-ENTRY call. (def!struct (exit (:include valued-node) - (:copier nil)) + (:copier nil)) ;; the ENTRY node that this is an exit for. If null, this is a ;; degenerate exit. A degenerate exit is used to "fill" an empty ;; block (which isn't allowed in IR1.) In a degenerate exit, Value diff --git a/version.lisp-expr b/version.lisp-expr index b85465aab..e628409c8 100644 --- a/version.lisp-expr +++ b/version.lisp-expr @@ -17,4 +17,4 @@ ;;; checkins which aren't released. (And occasionally for internal ;;; versions, especially for internal versions off the main CVS ;;; branch, it gets hairier, e.g. "0.pre7.14.flaky4.13".) -"0.8.18.5" +"0.8.18.7" -- 2.11.4.GIT