Fixup fewer complaints about hairy lexical environments

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.
This commit is contained in:
Christophe Rhodes 2012-03-24 14:00:08 +00:00
parent b04168702f
commit 1d881f74d4
3 changed files with 14 additions and 4 deletions

2
NEWS
View file

@ -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:

View 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

View 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