0.7.4.10:
authorWilliam Harold Newman <william.newman@airmail.net>
Sat, 1 Jun 2002 02:34:52 +0000 (02:34 +0000)
committerWilliam Harold Newman <william.newman@airmail.net>
Sat, 1 Jun 2002 02:34:52 +0000 (02:34 +0000)
fixed dumb error in debug.lisp/0.7.4.9 modifications (spotted
by eagle eyes of CSR)
Since I still don't have a good fix for the bogus "error in
constant folding" in %WITH-ARRAY-DATA-MACRO (e.g. in
compiling src/compiler/dump.lisp)...
...logged it as bug
...downgraded it from full WARNING to STYLE-WARNING to make the
bug less painful
...removed :IGNORE-FAILURE-P from src/compiler/dump and
src/code/cold-init entries in build-order.lisp-expr,
since the downgrade to STYLE-WARNING makes them
unneeded

BUGS
build-order.lisp-expr
doc/sbcl.1
src/code/debug.lisp
src/compiler/ir1opt.lisp
src/compiler/ir1util.lisp

diff --git a/BUGS b/BUGS
index c8f86e8..69f27e6 100644 (file)
--- a/BUGS
+++ b/BUGS
@@ -1243,6 +1243,21 @@ WORKAROUND:
   whereas section 3.4.4 of the CLHS doesn't allow required parameters
   to come after the rest argument.
 
   whereas section 3.4.4 of the CLHS doesn't allow required parameters
   to come after the rest argument.
 
+173:
+  The compiler sometimes tries to constant-fold expressions before
+  it checks to see whether they can be reached. This can lead to 
+  bogus warnings about errors in the constant folding, e.g. in code
+  like 
+    (WHEN X
+      (WRITE-STRING (> X 0) "+" "0"))
+  compiled in a context where the compiler can prove that X is NIL,
+  and the compiler complains that (> X 0) causes a type error because
+  NIL isn't a valid argument to #'>. Until sbcl-0.7.4.10 or so this
+  caused a full WARNING, which made the bug really annoying because then 
+  COMPILE and COMPILE-FILE returned FAILURE-P=T for perfectly legal
+  code. Since then the warning has been downgraded to STYLE-WARNING, 
+  so it's still a bug but at least it's a little less annoying.
+
 DEFUNCT CATEGORIES OF BUGS
   IR1-#:
     These labels were used for bugs related to the old IR1 interpreter.
 DEFUNCT CATEGORIES OF BUGS
   IR1-#:
     These labels were used for bugs related to the old IR1 interpreter.
index 76acd22..305d842 100644 (file)
 
  ;; Compiling this requires fop definitions from code/fop.lisp and
  ;; trace table definitions from compiler/trace-table.lisp.
 
  ;; Compiling this requires fop definitions from code/fop.lisp and
  ;; trace table definitions from compiler/trace-table.lisp.
- ("src/compiler/dump"
-  ;; FIXME: When building sbcl-0.pre7.14.flaky4.5 under sbcl-0.6.12.1
-  ;; with :SB-SHOW on the target *FEATURES* list, cross-compilation of
-  ;; this file gives a WARNING in HEXSTR,
-  ;;   Lisp error during constant folding:
-  ;;   Argument X is not a REAL: NIL
-  ;; This seems to come from DEF!MACRO %WITH-ARRAY-DATA-MACRO code
-  ;; which looks like
-  ;;     (cond (,end
-  ;;            (unless (or ,unsafe? (<= ,end ,size))
-  ;;             ..))
-  ;;           ..)
-  ;; where the system is trying to constant-fold the <= form when the
-  ;; ,END binding is known to be NIL at compile time. Since the <= form 
-  ;; is unreachable in that case, this shouldn't be signalling a WARNING;
-  ;; but as long as it is, we have to ignore it in order to go on.
-  :ignore-failure-p)
+ ("src/compiler/dump")
 
  ("src/compiler/main") ; needs DEFSTRUCT FASL-OUTPUT from dump.lisp
  ("src/compiler/target-main" :not-host)
 
  ("src/compiler/main") ; needs DEFSTRUCT FASL-OUTPUT from dump.lisp
  ("src/compiler/target-main" :not-host)
  ;; FIXME: Does this really need stuff from compiler/dump.lisp?
  ("src/compiler/target-dump" :not-host) ; needs stuff from compiler/dump.lisp
 
  ;; FIXME: Does this really need stuff from compiler/dump.lisp?
  ("src/compiler/target-dump" :not-host) ; needs stuff from compiler/dump.lisp
 
- ("src/code/cold-init" :not-host ; needs (SETF EXTERN-ALIEN) macroexpansion
-  ;; FIXME: When building sbcl-0.pre7.14.flaky4.5 under sbcl-0.6.12.1
-  ;; with :SB-SHOW on the target *FEATURES* list, cross-compilation of
-  ;; this file gives a WARNING in HEXSTR,
-  ;;   Lisp error during constant folding:
-  ;;   Argument X is not a REAL: NIL
-  ;; This seems to come from DEF!MACRO %WITH-ARRAY-DATA-MACRO code
-  ;; which looks like
-  ;;     (cond (,end
-  ;;            (unless (or ,unsafe? (<= ,end ,size))
-  ;;             ..))
-  ;;           ..)
-  ;; where the system is trying to constant-fold the <= form when the
-  ;; ,END binding is known to be NIL at compile time. Since the <= form 
-  ;; is unreachable in that case, this shouldn't be signalling a WARNING;
-  ;; but as long as it is, we have to ignore it in order to go on.
-  :ignore-failure-p)
+ ("src/code/cold-init" :not-host) ; needs (SETF EXTERN-ALIEN) macroexpansion
 
  ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  ;; target macros and DECLAIMs installed at build-the-cross-compiler time
 
  ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  ;; target macros and DECLAIMs installed at build-the-cross-compiler time
index 8a91b16..aee50e3 100644 (file)
@@ -317,10 +317,12 @@ By default, a Common Lisp system tries to ask the programmer for help
 when it gets in trouble (by printing a debug prompt on *DEBUG-IO*).
 However, this is not useful behavior for a system running with no
 programmer available, and this option tries to set up more appropriate
 when it gets in trouble (by printing a debug prompt on *DEBUG-IO*).
 However, this is not useful behavior for a system running with no
 programmer available, and this option tries to set up more appropriate
-behavior for that situation. Thus we set *DEBUG-IO* to send its
-output to *ERROR-OUTPUT*, and to raise an error if any input is
-requested from it; and we set *DEBUGGER-HOOK* to output a backtrace,
-then exit the process with a failure code.
+behavior for that situation. This is implemented by modifying special
+variables: we set *DEBUG-IO* to send its output to *ERROR-OUTPUT*, and
+to raise an error if any input is requested from it, and we set
+*DEBUGGER-HOOK* to output a backtrace, then exit the process with a
+failure code. Because it is implemented by modifying special variables,
+its effects persist in .core files created by SB-EXT:SAVE-LISP-AND-DIE.
 .PP
 
 Regardless of the order in which --sysinit, --userinit, and --eval
 .PP
 
 Regardless of the order in which --sysinit, --userinit, and --eval
index 8a7d166..faa5279 100644 (file)
@@ -1162,7 +1162,8 @@ argument")
 
 (!def-debug-command-alias "B" "BOTTOM")
 
 
 (!def-debug-command-alias "B" "BOTTOM")
 
-(!def-debug-command "FRAME" (&optional (n (read-prompting-maybe)))
+(!def-debug-command "FRAME" (&optional
+                            (n (read-prompting-maybe "frame number: ")))
   (setf *current-frame*
        (multiple-value-bind (next-frame-fun limit-string)
            (if (< n (sb!di:frame-number *current-frame*))
   (setf *current-frame*
        (multiple-value-bind (next-frame-fun limit-string)
            (if (< n (sb!di:frame-number *current-frame*))
index 3572089..5626039 100644 (file)
   (let ((args (mapcar #'continuation-value (combination-args call)))
        (fun-name (combination-fun-source-name call)))
     (multiple-value-bind (values win)
   (let ((args (mapcar #'continuation-value (combination-args call)))
        (fun-name (combination-fun-source-name call)))
     (multiple-value-bind (values win)
-       (careful-call fun-name args call "constant folding")
+       (careful-call fun-name
+                     args
+                     call
+                     ;; Note: CMU CL had COMPILER-WARN here, and that
+                     ;; seems more natural, but it's probably not.
+                     ;;
+                     ;; It's especially not while bug 173 exists:
+                     ;; Expressions like
+                     ;;   (COND (END
+                     ;;          (UNLESS (OR UNSAFE? (<= END SIZE)))
+                     ;;            ...))
+                     ;; can cause constant-folding TYPE-ERRORs (in
+                     ;; #'<=) when END can be proved to be NIL, even
+                     ;; though the code is perfectly legal and safe
+                     ;; because a NIL value of END means that the
+                     ;; #'<= will never be executed.
+                     ;;
+                     ;; Moreover, even without bug 173,
+                     ;; quite-possibly-valid code like
+                     ;;   (COND ((NONINLINED-PREDICATE END)
+                     ;;          (UNLESS (<= END SIZE))
+                     ;;            ...))
+                     ;; (where NONINLINED-PREDICATE is something the
+                     ;; compiler can't do at compile time, but which
+                     ;; turns out to make the #'<= expression
+                     ;; unreachable when END=NIL) could cause errors
+                     ;; when the compiler tries to constant-fold (<=
+                     ;; END SIZE).
+                     ;;
+                     ;; So, with or without bug 173, it'd be 
+                     ;; unnecessarily evil to do a full
+                     ;; COMPILER-WARNING (and thus return FAILURE-P=T
+                     ;; from COMPILE-FILE) for legal code, so we we
+                     ;; use a wimpier COMPILE-STYLE-WARNING instead.
+                     #'compiler-style-warn
+                     "constant folding")
       (if (not win)
          (setf (combination-kind call) :error)
          (let ((dummies (make-gensym-list (length args))))
       (if (not win)
          (setf (combination-kind call) :error)
          (let ((dummies (make-gensym-list (length args))))
index df17ebd..c1c1db8 100644 (file)
 
 ;;; Apply a function to some arguments, returning a list of the values
 ;;; resulting of the evaluation. If an error is signalled during the
 
 ;;; Apply a function to some arguments, returning a list of the values
 ;;; resulting of the evaluation. If an error is signalled during the
-;;; application, then we print a warning message and return NIL as our
-;;; second value to indicate this. Node is used as the error context
-;;; for any error message, and Context is a string that is spliced
-;;; into the warning.
-(declaim (ftype (function ((or symbol function) list node string)
+;;; application, then we produce a warning message using WARN-FUN and
+;;; return NIL as our second value to indicate this. NODE is used as
+;;; the error context for any error message, and CONTEXT is a string
+;;; that is spliced into the warning.
+(declaim (ftype (function ((or symbol function) list node function string)
                          (values list boolean))
                careful-call))
                          (values list boolean))
                careful-call))
-(defun careful-call (function args node context)
+(defun careful-call (function args node warn-fun context)
   (values
    (multiple-value-list
     (handler-case (apply function args)
       (error (condition)
        (let ((*compiler-error-context* node))
   (values
    (multiple-value-list
     (handler-case (apply function args)
       (error (condition)
        (let ((*compiler-error-context* node))
-         (compiler-warn "Lisp error during ~A:~%~A" context condition)
+         (funcall warn-fun "Lisp error during ~A:~%~A" context condition)
          (return-from careful-call (values nil nil))))))
    t))
 \f
          (return-from careful-call (values nil nil))))))
    t))
 \f