Update of /cvsroot/sbcl/sbcl
In directory sc8-pr-cvs1:/tmp/cvs-serv10604
Modified Files:
Tag: mti-1202
BUGS OPTIMIZATIONS version.lisp-expr
Log Message:
This EXPERIMENTAL branch contains some enhancements for type
inference.
In this version:
Changes in constraint propagation:
* constraint propagator searches a maximal stable set of constraints;
* disabled type inference from REFs;
* enabled type inference from SETs;
Random changes:
* CONSTANT-FOLD-CALL inserts new REF itself;
* type of SET is derived also in PROPAGATE-FROM-SETS;
* united BLOCK-KILL-SSET and BLOCK-KILL-LIST;
* removed hack for recursive TRANSLATE-LOGICAL-PATHNAME.
Index: BUGS
===================================================================
RCS file: /cvsroot/sbcl/sbcl/BUGS,v
retrieving revision 1.258
retrieving revision 1.258.2.1
diff -u -d -r1.258 -r1.258.2.1
--- BUGS 26 Dec 2002 20:05:02 -0000 1.258
+++ BUGS 28 Dec 2002 04:33:15 -0000 1.258.2.1
@@ -293,40 +293,6 @@
then requesting a BACKTRACE at the debugger prompt gives no information
about where in the user program the problem occurred.
-62:
- The compiler is supposed to do type inference well enough that
- the declaration in
- (TYPECASE X
- ((SIMPLE-ARRAY SINGLE-FLOAT)
- (LOCALLY
- (DECLARE (TYPE (SIMPLE-ARRAY SINGLE-FLOAT) X))
- ..))
- ..)
- is redundant. However, as reported by Juan Jose Garcia Ripoll for
- CMU CL, it sometimes doesn't. Adding declarations is a pretty good
- workaround for the problem for now, but can't be done by the TYPECASE
- macros themselves, since it's too hard for the macro to detect
- assignments to the variable within the clause.
- Note: The compiler *is* smart enough to do the type inference in
- many cases. This case, derived from a couple of MACROEXPAND-1
- calls on Ripoll's original test case,
- (DEFUN NEGMAT (A)
- (DECLARE (OPTIMIZE SPEED (SAFETY 0)))
- (COND ((TYPEP A '(SIMPLE-ARRAY SINGLE-FLOAT)) NIL
- (LET ((LENGTH (ARRAY-TOTAL-SIZE A)))
- (LET ((I 0) (G2554 LENGTH))
- (DECLARE (TYPE REAL G2554) (TYPE REAL I))
- (TAGBODY
- SB-LOOP::NEXT-LOOP
- (WHEN (>= I G2554) (GO SB-LOOP::END-LOOP))
- (SETF (ROW-MAJOR-AREF A I) (- (ROW-MAJOR-AREF A I)))
- (GO SB-LOOP::NEXT-LOOP)
- SB-LOOP::END-LOOP))))))
- demonstrates the problem; but the problem goes away if the TAGBODY
- and GO forms are removed (leaving the SETF in ordinary, non-looping
- code), or if the TAGBODY and GO forms are retained, but the
- assigned value becomes 0.0 instead of (- (ROW-MAJOR-AREF A I)).
-
63:
Paul Werkowski wrote on cmucl-imp@... 2000-11-15
I am looking into this problem that showed up on the cmucl-help
Index: OPTIMIZATIONS
===================================================================
RCS file: /cvsroot/sbcl/sbcl/OPTIMIZATIONS,v
retrieving revision 1.2
retrieving revision 1.2.2.1
diff -u -d -r1.2 -r1.2.2.1
--- OPTIMIZATIONS 27 Dec 2002 11:05:20 -0000 1.2
+++ OPTIMIZATIONS 28 Dec 2002 04:33:15 -0000 1.2.2.1
@@ -64,3 +64,23 @@
* And why two moves?
--------------------------------------------------------------------------------
+Constraint propagator does not know initial types of LET-introduced
+variables.
+
+(defun foo (x)
+ (declare (type bit x))
+ (declare (optimize speed))
+ (let ((y x))
+ (list (incf y)
+ (incf y 2))))
+
+This code uses generic arithmetic. Note that the following code
+is compiled cleanly:
+
+(defun foo (x)
+ (declare (type bit x))
+ (declare (optimize speed))
+ (let (y)
+ (list (setq y x)
+ (setq y (+ y 1)))))
+--------------------------------------------------------------------------------
Index: version.lisp-expr
===================================================================
RCS file: /cvsroot/sbcl/sbcl/version.lisp-expr,v
retrieving revision 1.710
retrieving revision 1.710.2.1
diff -u -d -r1.710 -r1.710.2.1
--- version.lisp-expr 27 Dec 2002 11:05:20 -0000 1.710
+++ version.lisp-expr 28 Dec 2002 04:33:15 -0000 1.710.2.1
@@ -18,4 +18,4 @@
;;; versions, especially for internal versions off the main CVS
;;; branch, it gets hairier, e.g. "0.pre7.14.flaky4.13".)
-"0.7.10.33"
+"0.7.10.33.mti"
|