Update of /cvsroot/sbcl/sbcl/src/compiler
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25438/src/compiler
Modified Files:
ir1opt.lisp ir1tran-lambda.lisp ir1tran.lisp ir1util.lisp
ir2tran.lisp ltn.lisp macros.lisp srctran.lisp stack.lisp
typetran.lisp
Log Message:
0.8.9.36:
Commit "ignore during cross-compilation" patch (CSR sbcl-devel
2004-04-05)
... bad treatment of IGNORE now gets a full WARNING during
cross-compilation;
... fix all the badness this reveals;
... implement SAME-ARG checking in LOGFOO type derivers;
... also add one more IGNORABLE in PCL (from Marcus Pearce);
... test for bad (signed-byte <N>) bug.
Index: ir1opt.lisp
===================================================================
RCS file: /cvsroot/sbcl/sbcl/src/compiler/ir1opt.lisp,v
retrieving revision 1.90
retrieving revision 1.91
diff -u -d -r1.90 -r1.91
--- ir1opt.lisp 4 Apr 2004 14:07:25 -0000 1.90
+++ ir1opt.lisp 13 Apr 2004 10:30:38 -0000 1.91
@@ -740,6 +740,7 @@
(ctran (node-next node))
(tail (component-tail (block-component block)))
(succ (first (block-succ block))))
+ (declare (ignore lvar))
(unless (or (and (eq node (block-last block)) (eq succ tail))
(block-delete-p block))
(when (eq (node-derived-type node) *empty-type*)
Index: ir1tran-lambda.lisp
===================================================================
RCS file: /cvsroot/sbcl/sbcl/src/compiler/ir1tran-lambda.lisp,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -d -r1.14 -r1.15
--- ir1tran-lambda.lisp 30 Mar 2004 16:58:26 -0000 1.14
+++ ir1tran-lambda.lisp 13 Apr 2004 10:30:38 -0000 1.15
@@ -261,6 +261,7 @@
;;; whereas NEXT is a variable naming a CTRAN in the body. -- CSR,
;;; 2004-03-30.
(defmacro with-dynamic-extent ((start body-start next kind) &body body)
+ (declare (ignore kind))
(with-unique-names (cleanup next-ctran)
`(progn
(ctran-starts-block ,body-start)
@@ -966,6 +967,7 @@
(source-name '.anonymous.)
debug-name
allow-debug-catch-tag)
+ (declare (ignore allow-debug-catch-tag))
(destructuring-bind (decls macros symbol-macros &rest body)
(if (eq (car fun) 'lambda-with-lexenv)
(cdr fun)
Index: ir1tran.lisp
===================================================================
RCS file: /cvsroot/sbcl/sbcl/src/compiler/ir1tran.lisp,v
retrieving revision 1.117
retrieving revision 1.118
diff -u -d -r1.117 -r1.118
--- ir1tran.lisp 30 Mar 2004 16:58:26 -0000 1.117
+++ ir1tran.lisp 13 Apr 2004 10:30:39 -0000 1.118
@@ -619,7 +619,12 @@
(when (lambda-var-ignorep var)
;; (ANSI's specification for the IGNORE declaration requires
;; that this be a STYLE-WARNING, not a full WARNING.)
- (compiler-style-warn "reading an ignored variable: ~S" name)))
+ #-sb-xc-host
+ (compiler-style-warn "reading an ignored variable: ~S" name)
+ ;; there's no need for us to accept ANSI's lameness when
+ ;; processing our own code, though.
+ #+sb-xc-host
+ (compiler-warn "reading an ignored variable: ~S" name)))
(reference-leaf start next result var))
(cons
(aver (eq (car var) 'MACRO))
Index: ir1util.lisp
===================================================================
RCS file: /cvsroot/sbcl/sbcl/src/compiler/ir1util.lisp,v
retrieving revision 1.89
retrieving revision 1.90
diff -u -d -r1.89 -r1.90
--- ir1util.lisp 4 Apr 2004 14:07:25 -0000 1.89
+++ ir1util.lisp 13 Apr 2004 10:30:39 -0000 1.90
@@ -1149,8 +1149,14 @@
(unless (policy *compiler-error-context* (= inhibit-warnings 3))
;; ANSI section "3.2.5 Exceptional Situations in the Compiler"
;; requires this to be no more than a STYLE-WARNING.
+ #-sb-xc-host
(compiler-style-warn "The variable ~S is defined but never used."
- (leaf-debug-name var)))
+ (leaf-debug-name var))
+ ;; There's no reason to accept this kind of equivocation
+ ;; when compiling our own code, though.
+ #+sb-xc-host
+ (compiler-warn "The variable ~S is defined but never used."
+ (leaf-debug-name var)))
(setf (leaf-ever-used var) t)))) ; to avoid repeated warnings? -- WHN
(values))
@@ -1466,8 +1472,7 @@
;;; exits to CONT in that entry, then return it, otherwise return NIL.
(defun find-nlx-info (exit)
(declare (type exit exit))
- (let* ((entry (exit-entry exit))
- (entry-cleanup (entry-cleanup entry)))
+ (let ((entry (exit-entry exit)))
(dolist (nlx (physenv-nlx-info (node-physenv entry)) nil)
(when (eq (nlx-info-exit nlx) exit)
(return nlx)))))
Index: ir2tran.lisp
===================================================================
RCS file: /cvsroot/sbcl/sbcl/src/compiler/ir2tran.lisp,v
retrieving revision 1.48
retrieving revision 1.49
diff -u -d -r1.48 -r1.49
--- ir2tran.lisp 4 Apr 2004 14:07:25 -0000 1.48
+++ ir2tran.lisp 13 Apr 2004 10:30:39 -0000 1.49
@@ -559,6 +559,7 @@
(defun find-template-result-types (call template rtypes)
(declare (type combination call)
(type template template) (list rtypes))
+ (declare (ignore template))
(let* ((dtype (node-derived-type call))
(type dtype)
(types (mapcar #'primitive-type
@@ -857,6 +858,7 @@
;;; lvar LOC.
;;; -- We don't know what it is.
(defun fun-lvar-tn (node block lvar)
+ (declare (ignore node block))
(declare (type lvar lvar))
(let ((2lvar (lvar-info lvar)))
(if (eq (ir2-lvar-kind 2lvar) :delayed)
Index: ltn.lisp
===================================================================
RCS file: /cvsroot/sbcl/sbcl/src/compiler/ltn.lisp,v
retrieving revision 1.28
retrieving revision 1.29
diff -u -d -r1.28 -r1.29
--- ltn.lisp 4 Apr 2004 14:07:25 -0000 1.28
+++ ltn.lisp 13 Apr 2004 10:30:39 -0000 1.29
@@ -434,6 +434,7 @@
(defun template-args-ok (template call safe-p)
(declare (type template template)
(type combination call))
+ (declare (ignore safe-p))
(let ((mtype (template-more-args-type template)))
(do ((args (basic-combination-args call) (cdr args))
(types (template-arg-types template) (cdr types)))
Index: macros.lisp
===================================================================
RCS file: /cvsroot/sbcl/sbcl/src/compiler/macros.lisp,v
retrieving revision 1.51
retrieving revision 1.52
diff -u -d -r1.51 -r1.52
--- macros.lisp 7 Apr 2004 14:22:36 -0000 1.51
+++ macros.lisp 13 Apr 2004 10:30:39 -0000 1.52
@@ -58,11 +58,12 @@
`(progn
(declaim (ftype (function (ctran ctran (or lvar null) t) (values))
,fn-name))
- (defun ,fn-name (,start-var ,next-var ,result-var ,n-form)
- (let ((,n-env *lexenv*))
- ,@decls
- ,body
- (values)))
+ (defun ,fn-name (,start-var ,next-var ,result-var ,n-form
+ &aux (,n-env *lexenv*))
+ (declare (ignorable ,start-var ,next-var ,result-var))
+ ,@decls
+ ,body
+ (values))
,@(when doc
`((setf (fdocumentation ',name 'function) ,doc)))
;; FIXME: Evidently "there can only be one!" -- we overwrite any
@@ -513,6 +514,7 @@
(let ((n-args (gensym)))
`(progn
(defun ,name (,n-node ,@vars)
+ (declare (ignorable ,@vars))
(let ((,n-args (basic-combination-args ,n-node)))
,(parse-deftransform lambda-list body n-args
`(return-from ,name nil))))
Index: srctran.lisp
===================================================================
RCS file: /cvsroot/sbcl/sbcl/src/compiler/srctran.lisp,v
retrieving revision 1.105
retrieving revision 1.106
diff -u -d -r1.105 -r1.106
--- srctran.lisp 4 Apr 2004 14:07:25 -0000 1.105
+++ srctran.lisp 13 Apr 2004 10:30:39 -0000 1.106
@@ -2121,7 +2121,8 @@
(values nil t t)))
(defun logand-derive-type-aux (x y &optional same-leaf)
- (declare (ignore same-leaf))
+ (when same-leaf
+ (return-from logand-derive-type-aux x))
(multiple-value-bind (x-len x-pos x-neg) (integer-type-length x)
(declare (ignore x-pos))
(multiple-value-bind (y-len y-pos y-neg) (integer-type-length y)
@@ -2153,7 +2154,8 @@
(specifier-type 'integer)))))))
(defun logior-derive-type-aux (x y &optional same-leaf)
- (declare (ignore same-leaf))
+ (when same-leaf
+ (return-from logior-derive-type-aux x))
(multiple-value-bind (x-len x-pos x-neg) (integer-type-length x)
(multiple-value-bind (y-len y-pos y-neg) (integer-type-length y)
(cond
@@ -2192,7 +2194,8 @@
(specifier-type 'integer))))))))
(defun logxor-derive-type-aux (x y &optional same-leaf)
- (declare (ignore same-leaf))
+ (when same-leaf
+ (return-from logxor-derive-type-aux (specifier-type '(eql 0))))
(multiple-value-bind (x-len x-pos x-neg) (integer-type-length x)
(multiple-value-bind (y-len y-pos y-neg) (integer-type-length y)
(cond
@@ -2230,7 +2233,7 @@
(defoptimizer (logeqv derive-type) ((x y))
(two-arg-derive-type x y (lambda (x y same-leaf)
(lognot-derive-type-aux
- (logxor-derive-type-aux x y same-leaf)))
+ (logxor-derive-type-aux x y same-leaf)))
#'logeqv))
(defoptimizer (lognand derive-type) ((x y))
(two-arg-derive-type x y (lambda (x y same-leaf)
@@ -2242,25 +2245,34 @@
(lognot-derive-type-aux
(logior-derive-type-aux x y same-leaf)))
#'lognor))
+;;; FIXME: use SAME-LEAF instead of ignoring it.
(defoptimizer (logandc1 derive-type) ((x y))
(two-arg-derive-type x y (lambda (x y same-leaf)
- (logand-derive-type-aux
- (lognot-derive-type-aux x) y nil))
+ (if same-leaf
+ (specifier-type '(eql 0))
+ (logand-derive-type-aux
+ (lognot-derive-type-aux x) y nil)))
#'logandc1))
(defoptimizer (logandc2 derive-type) ((x y))
(two-arg-derive-type x y (lambda (x y same-leaf)
- (logand-derive-type-aux
- x (lognot-derive-type-aux y) nil))
+ (if same-leaf
+ (specifier-type '(eql 0))
+ (logand-derive-type-aux
+ x (lognot-derive-type-aux y) nil)))
#'logandc2))
(defoptimizer (logorc1 derive-type) ((x y))
(two-arg-derive-type x y (lambda (x y same-leaf)
- (logior-derive-type-aux
- (lognot-derive-type-aux x) y nil))
+ (if same-leaf
+ (specifier-type '(eql -1))
+ (logior-derive-type-aux
+ (lognot-derive-type-aux x) y nil)))
#'logorc1))
(defoptimizer (logorc2 derive-type) ((x y))
(two-arg-derive-type x y (lambda (x y same-leaf)
- (logior-derive-type-aux
- x (lognot-derive-type-aux y) nil))
+ (if same-leaf
+ (specifier-type '(eql -1))
+ (logior-derive-type-aux
+ x (lognot-derive-type-aux y) nil)))
#'logorc2))
;;;; miscellaneous derive-type methods
Index: stack.lisp
===================================================================
RCS file: /cvsroot/sbcl/sbcl/src/compiler/stack.lisp,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -d -r1.11 -r1.12
--- stack.lisp 18 Feb 2004 03:04:10 -0000 1.11
+++ stack.lisp 13 Apr 2004 10:30:39 -0000 1.12
@@ -65,6 +65,7 @@
(new-end end)
(cleanup (block-end-cleanup block))
(found-similar-p nil))
+ (declare (ignore #-nil cleanup))
(dolist (succ (block-succ block))
#+nil
(when (and (< block succ)
Index: typetran.lisp
===================================================================
RCS file: /cvsroot/sbcl/sbcl/src/compiler/typetran.lisp,v
retrieving revision 1.40
retrieving revision 1.41
diff -u -d -r1.40 -r1.41
--- typetran.lisp 15 Sep 2003 09:21:38 -0000 1.40
+++ typetran.lisp 13 Apr 2004 10:30:39 -0000 1.41
@@ -243,13 +243,13 @@
;;; Do source transformation for TYPEP of a known union type. If a
;;; union type contains LIST, then we pull that out and make it into a
-;;; single LISTP call. Note that if SYMBOL is in the union, then LIST
-;;; will be a subtype even without there being any (member NIL). We
-;;; just drop through to the general code in this case, rather than
-;;; trying to optimize it.
+;;; single LISTP call. Note that if SYMBOL is in the union, then LIST
+;;; will be a subtype even without there being any (member NIL). We
+;;; currently just drop through to the general code in this case,
+;;; rather than trying to optimize it (but FIXME CSR 2004-04-05: it
+;;; wouldn't be hard to optimize it after all).
(defun source-transform-union-typep (object type)
(let* ((types (union-type-types type))
- (type-list (specifier-type 'list))
(type-cons (specifier-type 'cons))
(mtype (find-if #'member-type-p types))
(members (when mtype (member-type-members mtype))))
|