From: Alexey D. <ade...@us...> - 2004-01-31 17:06:02
|
Update of /cvsroot/sbcl/sbcl/tests In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13040/tests Modified Files: compiler.pure.lisp Log Message: 0.8.7.34: * Make transforms and optimizers for MAX and MIN consistent with their definitions. Index: compiler.pure.lisp =================================================================== RCS file: /cvsroot/sbcl/sbcl/tests/compiler.pure.lisp,v retrieving revision 1.83 retrieving revision 1.84 diff -u -d -r1.83 -r1.84 --- compiler.pure.lisp 17 Jan 2004 05:52:21 -0000 1.83 +++ compiler.pure.lisp 31 Jan 2004 17:04:14 -0000 1.84 @@ -1117,3 +1117,20 @@ 'integer))) (funcall #'%f12 0)))) -33))) + +;;; Discussion of a CMUCL PCL bug on Sparc with Raymond Toy revealed a +;;; potential problem: optimizers and type derivers for MAX and MIN +;;; were not consistent in treating EQUALP, but not EQL, arguments. +(dolist (f '(min max)) + (loop for complex-arg-args in '((1d0 2d0) (0d0 1d0)) + for complex-arg = `(if x ,@complex-arg-args) + do + (loop for args in `((1 ,complex-arg) + (,complex-arg 1)) + for form = `(,f ,@args) + for f1 = (compile nil `(lambda (x) ,form)) + and f2 = (compile nil `(lambda (x) (declare (notinline min max)) + ,form)) + do + (dolist (x '(nil t)) + (assert (eql (funcall f1 x) (funcall f2 x))))))) |