0.pre7.14.flaky4.10:
authorWilliam Harold Newman <william.newman@airmail.net>
Thu, 23 Aug 2001 22:11:58 +0000 (22:11 +0000)
committerWilliam Harold Newman <william.newman@airmail.net>
Thu, 23 Aug 2001 22:11:58 +0000 (22:11 +0000)
fixed FLOAT-RADIX problem in float.pure.lisp
found bug 120a/120b in the #!-SB-INTERPRETER case of
POSSIBLY-AN-INTERPRETED-FRAME, and rewrote it to
work around the bug
made INTERNAL-EVAL go on to call the function even when
FAILURE-P, since that's the right thing to do when
e.g. there are type mismatch errors on code paths
which turn out never to be executed
similarly, made COMPILE set FDEFINITION even when FAILURE-P
also fixed bug in COMPILE (and added test case): it's
supposed to set MACRO-FUNCTION when NAME names a macro

BUGS
src/code/debug-int.lisp
src/code/float.lisp
src/code/target-eval.lisp
src/compiler/target-main.lisp
tests/float.pure.lisp
version.lisp-expr

diff --git a/BUGS b/BUGS
index 925e4b7..0d690db 100644 (file)
--- a/BUGS
+++ b/BUGS
@@ -1148,6 +1148,27 @@ Error in function C::GET-LAMBDA-TO-COMPILE:
 
    The native compiler handles it fine, both in SBCL and in CMU CL.
 
+120a:
+   The compiler incorrectly figures the return type of 
+       (DEFUN FOO (FRAME UP-FRAME)
+         (IF (OR (NOT FRAME)
+                 T)
+             FRAME
+             "BAR"))
+   as NIL.
+
+   This problem exists in CMU CL 18c too. When I reported it on
+   cmucl-imp@cons.org, Raymond Toy replied 23 Aug 2001 with 
+   a partial explanation, but no fix has been found yet.
+
+120b:
+   Even in sbcl-0.pre7.x, which is supposed to be free of the old
+   non-ANSI behavior of treating the function return type inferred
+   from the current function definition as a declaration of the
+   return type from any function of that name, the return type of NIL
+   is attached to FOO in 120a above, and used to optimize code which
+   calls FOO. 
+
 KNOWN BUGS RELATED TO THE IR1 INTERPRETER
 
 (Note: At some point, the pure interpreter (actually a semi-pure
index e04aa31..2572bd3 100644 (file)
 ;;; call to SB!EVAL::INTERNAL-APPLY-LOOP, we make an interpreted frame
 ;;; to replace FRAME. The interpreted frame points to FRAME.
 (defun possibly-an-interpreted-frame (frame up-frame)
+
+  ;; trivial without SB-INTERPRETER
+  #!-sb-interpreter (declare (ignore up-frame))
+  #!-sb-interpreter frame
+
+  ;; nontrivial with SB-INTERPRETER
+  #!+sb-interpreter 
   (if (or (not frame)
-         #!+sb-interpreter (not (eq (debug-function-name (frame-debug-function
-                                                          frame))
-                                    'sb!eval::internal-apply-loop))
-         #!-sb-interpreter t
+         (not (eq (debug-function-name (frame-debug-function
+                                        frame))
+                  'sb!eval::internal-apply-loop))
          *debugging-interpreter*
          (compiled-frame-escaped frame))
       frame
index 3e8f9f5..ffd5f5b 100644 (file)
 (defun float-radix (x)
   #!+sb-doc
   "Return (as an integer) the radix b of its floating-point argument."
-  (declare (type float x))
   ;; ANSI says this function "should signal an error if [..] argument
   ;; is not a float". Since X is otherwise ignored, Python doesn't
   ;; check the type by default, so we have to do it ourself:
index aea4187..6003b6c 100644 (file)
 ;;; EVAL-WHEN magic properly): Delegate to the byte compiler.
 #!-sb-interpreter
 (defun sb!eval:internal-eval (expr)
-  (let ((name (gensym "EVAL-TMPFUN-")))
-    (multiple-value-bind (fun warnings-p failure-p)
-        (compile name
-                 `(lambda ()
-                    (declare (optimize (speed 0) (debug 1))) ; to byte-compile
-                    (declare (optimize (space 1) (safety 1)))
-                   (declare (optimize (compilation-speed 3)))
-                    ,expr))
-      (declare (ignore warnings-p))
-      (if failure-p
-          (error 'simple-program-error
-                 :format-control
-                 "~@<failure when precompiling ~2I~_~S ~I~_ for ~S"
-                 :format-arguments (list expr 'eval))
-          (funcall fun)))))
+  (funcall (compile (gensym "EVAL-TMPFUN-")
+                   `(lambda ()
+                      ;; SPEED=0,DEBUG=1 => byte-compile
+                      (declare (optimize (speed 0) (debug 1))) 
+                      (declare (optimize (space 1) (safety 1)))
+                      (declare (optimize (compilation-speed 3)))
+                      ,expr))))
 
 ;;; Given a function, return three values:
 ;;; 1] A lambda expression that could be used to define the function,
index c77d7eb..0b432ea 100644 (file)
   to a compiled function, returning (VALUES THING WARNINGS-P FAILURE-P),
   where if NAME is NIL, THING is the result of compilation, and
   otherwise THING is NAME. When NAME is not NIL, the compiled function
-  is also set into (FDEFINITION NAME)."
+  is also set into (MACRO-FUNCTION NAME) if NAME names a macro, or into
+  (FDEFINITION NAME) otherwise."
   (multiple-value-bind (compiled-definition warnings-p failure-p)
       (if (compiled-function-p definition)
          (values definition nil nil)
          (actually-compile name definition))
     (cond (name
-          (unless failure-p
-            (setf (fdefinition name) compiled-definition))
+          (if (macro-function name)
+              (setf (macro-function name) compiled-definition)
+              (setf (fdefinition name) compiled-definition))
           (values name warnings-p failure-p))
          (t
           (values compiled-definition warnings-p failure-p)))))
index c3abd91..ab395ad 100644 (file)
@@ -46,6 +46,5 @@
 ;;;
 ;;; (Peter Van Eynde's ansi-test suite caught this, and Eric Marsden
 ;;; reported a fix for CMU CL, which was ported to sbcl-0.6.12.35.)
-#+nil ; FIXME: Something in sbcl-0.7.pre15 broke this again.
 (assert (typep (nth-value 1 (ignore-errors (float-radix "notfloat")))
-              'type-error))
\ No newline at end of file
+              'type-error))
index 8f43acd..5d6f60b 100644 (file)
@@ -16,4 +16,4 @@
 ;;; four numeric fields, is used for versions which aren't released
 ;;; but correspond only to CVS tags or snapshots.
 
-"0.pre7.14.flaky4.9"
+"0.pre7.14.flaky4.10"