Fixup fewer complaints about hairy lexical environments
authorChristophe Rhodes <csr21@cantab.net>
Sat, 24 Mar 2012 14:00:08 +0000 (14:00 +0000)
committerChristophe Rhodes <csr21@cantab.net>
Sat, 24 Mar 2012 14:02:22 +0000 (14:02 +0000)
In particular, if the function has been requested NOTINLINE, and that name
has never been INLINE or MAYBE-INLINE, there should be no compiler note.
Include a test case and a NEWS entry for posterity.

NEWS
src/code/defboot.lisp
tests/compiler.test.sh

diff --git a/NEWS b/NEWS
index 6a2e7f2..39dbb6c 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -6,6 +6,8 @@ changes relative to sbcl-1.0.55:
   * enhancements
     ** SBCL can now be built using Clang.
   * bug fix: compiler errors when weakening hairy integer types. (lp#913232)
+  * bug fix: don't complain about a too-hairy lexical environment for inlining
+    when the function has never been requested for inlining.  (lp#963530)
 
 changes in sbcl-1.0.55 relative to sbcl-1.0.54:
   * enhancements to building SBCL using make.sh:
index 778a7ab..2285b4f 100644 (file)
@@ -152,7 +152,8 @@ evaluated as a PROGN."
 (defun inline-fun-name-p (name)
   (or
    ;; the normal reason for saving the inline expansion
-   (info :function :inlinep name)
+   (let ((inlinep (info :function :inlinep name)))
+     (member inlinep '(:inline :maybe-inline)))
    ;; another reason for saving the inline expansion: If the
    ;; ANSI-recommended idiom
    ;;   (DECLAIM (INLINE FOO))
@@ -181,10 +182,8 @@ evaluated as a PROGN."
            (lambda `(lambda ,@lambda-guts))
            #-sb-xc-host
            (named-lambda `(named-lambda ,name ,@lambda-guts))
-           (inline-type (inline-fun-name-p name))
            (inline-lambda
-            (when (and inline-type
-                       (neq inline-type :notinline))
+            (when (inline-fun-name-p name)
               ;; we want to attempt to inline, so complain if we can't
               (or (sb!c:maybe-inline-syntactic-closure lambda env)
                   (progn
index 447505c..f2921ef 100644 (file)
@@ -504,5 +504,14 @@ cat > $tmpfilename <<EOF
 EOF
 expect_clean_compile $tmpfilename
 
+cat > $tmpfilename <<EOF
+(in-package :cl-user)
+
+(declaim (notinline foo))
+(let ((i 0)) (defun foo (x) (incf i x)))
+(defun bar (x) (foo x))
+EOF
+fail_on_condition_during_compile sb-ext:compiler-note $tmpfilename
+
 # success
 exit $EXIT_TEST_WIN