(see also bug 117)
-280: bogus WARNING about duplicate function definition
- In sbcl-0.8.3 and sbcl-0.8.1.47, if BS.MIN is defined inline,
- e.g. by
- (declaim (inline bs.min))
- (defun bs.min (bases) nil)
- before compiling the file below, the compiler warns
- Duplicate definition for BS.MIN found in one static
- unit (usually a file).
- when compiling
- (declaim (special *minus* *plus* *stagnant*))
- (defun b.*.min (&optional (x () xp) (y () yp) &rest rest)
- (bs.min avec))
- (define-compiler-macro b.*.min (&rest rest)
- `(bs.min ,@rest))
- (defun afish-d-rbd (pd)
- (if *stagnant*
- (b.*.min (foo-d-rbd *stagnant*))
- (multiple-value-bind (reduce-fn initial-value)
- (etypecase pd
- (list (values #'bs.min 0))
- (vector (values #'bs.min *plus*)))
- (let ((cv-ks (cv (kpd.ks pd))))
- (funcall reduce-fn d-rbds)))))
- (defun bfish-d-rbd (pd)
- (if *stagnant*
- (b.*.min (foo-d-rbd *stagnant*))
- (multiple-value-bind (reduce-fn initial-value)
- (etypecase pd
- (list (values #'bs.min *minus*))
- (vector (values #'bs.min 0)))
- (let ((cv-ks (cv (kpd.ks pd))))
- (funcall reduce-fn d-rbds)))))
-
281: COMPUTE-EFFECTIVE-METHOD error signalling.
(slightly obscured by a non-0 default value for
SB-PCL::*MAX-EMF-PRECOMPUTE-METHODS*)
spurious errors should two threads attempt to tokenise at the same
time.
-312:
- (reported by Jon Dyte)
- SBCL issues a warning "Duplicate definition of FOO" compiling
-
- (declaim (inline foo))
- (defun foo (x)
- (1+ x))
- (defun bar (y)
- (list (foo y) (if (> y 1) (funcall (if (> y 0) #'foo #'identity) y))))
-
- (probably related to the bug 280.)
-
314: "LOOP :INITIALLY clauses and scope of initializers"
reported by Bruno Haible sbcl-devel "various SBCL bugs" from CLISP
test suite, originally by Thomas F. Burdick.
* fixed bug: as reported by Juan Ripoll on cmucl-imp,
MULTIPLE-VALUE-BIND should be able to lexically bind lambda list
keywords.
+ * fixed bugs 280 and 312: the checking for multiple definitions in a
+ file is less likely to become confused by uses of inline
+ functions.
* optimization: rearranged the expansion of various defining macros
so that each expands into only one top-level form in a
:LOAD-TOPLEVEL context; this appears to decrease fasl sizes by
(cold-fset ,name ,lambda)
(eval-when (:compile-toplevel)
- (sb!c:%compiler-defun ',name ',inline-lambda))
+ (sb!c:%compiler-defun ',name ',inline-lambda t))
(eval-when (:load-toplevel :execute)
(%defun ',name
;; In normal compilation (not for cold load) this is
(declare (type function def))
(declare (type (or null simple-string) doc))
(aver (legal-fun-name-p name)) ; should've been checked by DEFMACRO DEFUN
- (sb!c:%compiler-defun name inline-lambda)
+ (sb!c:%compiler-defun name inline-lambda nil)
(when (fboundp name)
(/show0 "redefining NAME in %DEFUN")
(style-warn "redefining ~S in DEFUN" name))
;;; versions which break binary compatibility. But it certainly should
;;; be incremented for release versions which break binary
;;; compatibility.
-(def!constant +fasl-file-version+ 49)
+(def!constant +fasl-file-version+ 50)
;;; (record of versions before 2003 deleted in 2003-04-26/0.pre8.107 or so)
;;; 38: (2003-01-05) changed names of internal SORT machinery
;;; 39: (2003-02-20) in 0.7.12.1 a slot was added to
;;; microefficiency in sbcl-0.8.8.10
;;; 49: (2004-05-04) Changed implementation of DEFFOO macros and the
;;; functions they expand to.
+;;; 50: (2004-05-20) Changed %COMPILER-DEFUN signature again.
;;; the conventional file extension for our fasl files
(declaim (type simple-string *fasl-file-type*))
(type-specifier declared-ftype)
(type-specifier defined-ftype)))))
(:defined
- (setf (info :function :type source-name) defined-ftype)))
- (when (fasl-output-p *compile-object*)
- (if (member source-name *fun-names-in-this-file* :test #'equal)
- (compiler-warn "~@<Duplicate definition for ~S found in ~
- one static unit (usually a file).~@:>"
- source-name)
- (push source-name *fun-names-in-this-file*)))))))
+ (setf (info :function :type source-name) defined-ftype)))))))
(values))
;;; Find all calls in COMPONENT to assumed functions and update the
;;;
;;; The INLINE-EXPANSION is a LAMBDA-WITH-LEXENV, or NIL if there is
;;; no inline expansion.
-(defun %compiler-defun (name lambda-with-lexenv)
+(defun %compiler-defun (name lambda-with-lexenv compile-toplevel)
(let ((defined-fun nil)) ; will be set below if we're in the compiler
- (when (boundp '*lexenv*) ; when in the compiler
+ (when compile-toplevel
+ ;; better be in the compiler
+ (aver (boundp '*lexenv*))
(when sb!xc:*compile-print*
(compiler-mumble "~&; recognizing DEFUN ~S~%" name))
(remhash name *free-funs*)
- (setf defined-fun (get-defined-fun name)))
+ (setf defined-fun (get-defined-fun name))
- (become-defined-fun-name name)
+ (aver (fasl-output-p *compile-object*))
+ (if (member name *fun-names-in-this-file* :test #'equal)
+ (compiler-warn "~@<Duplicate definition for ~S found in ~
+ one static unit (usually a file).~@:>"
+ name)
+ (push name *fun-names-in-this-file*)))
+ (become-defined-fun-name name)
+
(cond (lambda-with-lexenv
(setf (info :function :inline-expansion-designator name)
lambda-with-lexenv)
EOF
expect_clean_compile $tmpfilename
+# This shouldn't fail because it's not really a multiple definition
+cat > $tmpfilename <<EOF
+ (in-package :cl-user)
+ (eval-when (:compile-toplevel :load-toplevel :execute)
+ (defun foo (x) x))
+EOF
+expect_clean_compile $tmpfilename
+
+# Likewise
+cat > $tmpfilename <<EOF
+ (in-package :cl-user)
+ (eval-when (:compile-toplevel)
+ (defun foo (x) x))
+ (defun foo (x) x)
+EOF
+expect_clean_compile $tmpfilename
+
# This shouldn't fail despite the apparent type mismatch, because of
# the NOTINLINE declamation.
cat > $tmpfilename <<EOF
EOF
expect_clean_compile $tmpfilename
+# This shouldn't fail, but did until sbcl-0.8.10.4x
+cat > $tmpfilename <<EOF
+ (in-package :cl-user)
+ (declaim (inline foo))
+ (defun foo (x)
+ (1+ x))
+ (defun bar (y)
+ (list (foo y) (if (> y 1) (funcall (if (> y 0) #'foo #'identity) y))))
+EOF
+expect_clean_compile $tmpfilename
+
# This shouldn't fail despite the apparent type mismatch, because of
# the NOTINLINE declaration.
cat > $tmpfilename <<EOF
;;; 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.10.40"
+"0.8.10.41"