(deftransform search ...) produces unexpected code-deletion-note
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
SBCL |
Fix Released
|
Undecided
|
Unassigned |
Bug Description
When compile-file the code below, compiler notifies an unexpected code-deletion-note on #'sb-c::oops from (deftransform search ...).
;; search-foo.lisp
(in-package :cl-user)
(defun search-foo (s)
(declare (optimize (speed 3) (safety 0))
(type simple-string s))
(search "foo" s))
The policy (optimize (speed 3) (safety)) inhibits bounds checking in (deftransform search ...) that causes #'sb-c::oops becoming unused code.
onixie@
This is SBCL 1.1.0.46-3a34044, an implementation of ANSI Common Lisp.
More information about SBCL is available at <http://
SBCL is free software, provided as is, with absolutely no warranty.
It is mostly in the public domain; some portions are provided under
BSD-style licenses. See the CREDITS and COPYING files in the
distribution for more information.
* (compile-file "search-foo.lisp")
; compiling file "/home/
; compiling (IN-PACKAGE :CL-USER)
; compiling (DEFUN SEARCH-FOO ...)
; file: /home/onixie/
; in: DEFUN SEARCH-FOO
; (SEARCH "foo" S)
; --> BLOCK
; ==>
; (FLET ((SB-C::OOPS (VECTOR SB-C::START SB-C::END)
; (SB-INT:
; SB-C::END)))
; (LET* ((SB-C::LEN1 (LENGTH SB-C::PATTERN))
; (SB-C::LEN2 (LENGTH SB-C::TEXT))
; (SB-C::END1 (OR SB-C::END1 SB-C::LEN1))
; (SB-C::END2 (OR SB-C::END2 SB-C::LEN2)))
; (DECLARE
; (TYPE SB-INT:INDEX SB-C::START1 SB-C::START2 SB-C::END1 SB-C::END2))
; (WHEN (= SB-C::END1 SB-C::START1)
; (RETURN-FROM SEARCH
; (IF SB-C::FROM-END
; SB-C::END2
; SB-C::START2)))
; (DO ((SB-C::INDEX2 SB-C::START2 #))
; ((>= SB-C::INDEX2 SB-C::END2) NIL)
; (DECLARE (TYPE FIXNUM SB-C::INDEX2))
; (WHEN (DO # # # # #) (RETURN SB-C::INDEX2)))))
;
; note: deleting unused function
; (FLET SB-C::OOPS :IN SEARCH)
;
; compilation unit finished
; printed 1 note
; /home/onixie/
; compilation finished in 0:00:00.026
#P"/home/
NIL
NIL
onixie@
Linux onixie-laptop 3.2.0-31-generic #50-Ubuntu SMP Fri Sep 7 16:16:45 UTC 2012 x86_64 x86_64 x86_64 GNU/Linux
SBCL@CL-USER> *features*
(:SWANK :QUICKLISP :SB-BSD-
:COMMON-LISP :SBCL :SB-DOC :SB-TEST :SB-LDB :SB-PACKAGE-LOCKS :SB-UNICODE
:SB-EVAL :SB-SOURCE-
:OS-PROVIDES-
:OS-PROVIDES-PUTWC :OS-PROVIDES-DLADDR :OS-PROVIDES-DLOPEN :LITTLE-ENDIAN
:MULTIPLY-
:COMPLEX-
:STACK-
:STACK-
:UNWIND-
:C-STACK-
:SB-FUTEX :SB-THREAD :LINUX :ELF :UNIX :X86-64)
Changed in sbcl: | |
status: | New → Fix Released |
In 010c3b27431e8ec 1eb4291d828a74b c434e0e90c.