From 208e7b3072e383a2b2555ee259c9691e45cac3d6 Mon Sep 17 00:00:00 2001 From: Alexey Dejneka Date: Mon, 1 Nov 2004 03:44:13 +0000 Subject: [PATCH] 0.8.16.21: * Keep the principle "reanalysis implies reoptimization" on the last reoptimization pass (fix bug MISC.436, 438). --- NEWS | 1 + src/compiler/main.lisp | 3 ++- tests/compiler.pure.lisp | 44 ++++++++++++++++++++++++++++++++++++++++++++ version.lisp-expr | 2 +- 4 files changed, 48 insertions(+), 2 deletions(-) diff --git a/NEWS b/NEWS index 1c35f54..8d00b75 100644 --- a/NEWS +++ b/NEWS @@ -39,6 +39,7 @@ changes in sbcl-0.8.17 relative to sbcl-0.8.16: names. ** constraint propagation and lambda variable substitution are more cautious in dealing with partially deleted code. + ** compiler sometimes lost reoptimization passes. changes in sbcl-0.8.16 relative to sbcl-0.8.15: * enhancement: saving cores with foreign code loaded is now diff --git a/src/compiler/main.lisp b/src/compiler/main.lisp index 7427c2c..cabe030 100644 --- a/src/compiler/main.lisp +++ b/src/compiler/main.lisp @@ -297,7 +297,8 @@ (ir1-optimize component) (cond ((component-reoptimize component) (incf count) - (when (= count *max-optimize-iterations*) + (when (and (= count *max-optimize-iterations*) + (not (component-reanalyze component))) (maybe-mumble "*") (cond ((retry-delayed-ir1-transforms :optimize) (maybe-mumble "+") diff --git a/tests/compiler.pure.lisp b/tests/compiler.pure.lisp index 9072fbb..3bbe2c5 100644 --- a/tests/compiler.pure.lisp +++ b/tests/compiler.pure.lisp @@ -1554,3 +1554,47 @@ tag2) 0))) 3021871717588 -866608 -2 -17194))) + +;;; MISC.436, 438: lost reoptimization +(assert (zerop (funcall + (compile + nil + '(lambda (a b) + (declare (type (integer -2917822 2783884) a)) + (declare (type (integer 0 160159) b)) + (declare (ignorable a b)) + (declare + (optimize (compilation-speed 1) + (speed 3) + (safety 3) + (space 0) + ; #+sbcl (sb-c:insert-step-conditions 0) + (debug 0))) + (if + (oddp + (loop for + lv1 + below + 2 + count + (logbitp 0 + (1- + (ash b + (min 8 + (count 0 + '(-10197561 486 430631291 + 9674068)))))))) + b + 0))) + 1265797 110757))) + +(assert (zerop (funcall + (compile + nil + ' (lambda (a) + (declare (type (integer 0 1696) a)) + ; (declare (ignorable a)) + (declare (optimize (space 2) (debug 0) (safety 1) + (compilation-speed 0) (speed 1))) + (if (logbitp 0 (ash (1- a) (min 11 a))) 0 0))) + 805))) diff --git a/version.lisp-expr b/version.lisp-expr index 0a35692..36d6358 100644 --- a/version.lisp-expr +++ b/version.lisp-expr @@ -17,4 +17,4 @@ ;;; 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.16.20" +"0.8.16.21" -- 1.7.10.4