Unexpected undefined function error with sb-rotate-byte, inline, let

Bug #1423682 reported by Lutz Euler
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
SBCL
Fix Released
Undecided
Douglas Katzman

Bug Description

When entering the following sequence of expressions at the REPL the last one signals an error. I expected it not to, but instead to return 0.
This is SBCL 1.2.8.71-894fc3c, x86-64, linux, built with default options.

(require 'sb-rotate-byte)

(declaim (inline f))

(defun f (x)
  (declare (type (unsigned-byte 64) x))
  (setf x (sb-rotate-byte:rotate-byte 14 (byte 64 0) x))
  (setf x (sb-rotate-byte:rotate-byte 33 (byte 64 0) x)))

(let () (f 0))

; in: LET ()
; (F 0)
; --> BLOCK SETF SETQ THE SB-ROTATE-BYTE:ROTATE-BYTE
; --> SB-ROTATE-BYTE::%ROTATE-BYTE
; ==>
; (SB-ROTATE-BYTE::%UNSIGNED-64-ROTATE-BYTE COUNT INTEGER)
;
; caught STYLE-WARNING:
; Lisp error during constant folding:
; The function SB-ROTATE-BYTE::%UNSIGNED-64-ROTATE-BYTE is undefined.
;
; compilation unit finished
; caught 1 STYLE-WARNING condition

debugger invoked on a UNDEFINED-FUNCTION in thread
#<THREAD "main thread" RUNNING {1002D7E9E3}>:
  The function SB-ROTATE-BYTE::%UNSIGNED-64-ROTATE-BYTE is undefined.

Type HELP for debugger help, or (SB-EXT:EXIT) to exit from SBCL.

restarts (invokable by number or by possibly-abbreviated name):
  0: [ABORT] Exit debugger, returning to top level.

("undefined function")
0] backtrace

Backtrace for: #<SB-THREAD:THREAD "main thread" RUNNING {1002D7E9E3}>
0: ("undefined function")
1: ((LAMBDA ()))
2: (SB-INT:SIMPLE-EVAL-IN-LEXENV (LET NIL (F 0)) #<NULL-LEXENV>)
3: (EVAL (LET NIL (F 0)))
4: (INTERACTIVE-EVAL (LET NIL (F 0)) :EVAL NIL)
5: (SB-IMPL::REPL-FUN NIL)
6: ((LAMBDA NIL :IN SB-IMPL::TOPLEVEL-REPL))
7: (SB-IMPL::%WITH-REBOUND-IO-SYNTAX #<CLOSURE (LAMBDA NIL :IN SB-IMPL::TOPLEVEL-REPL) {10044FB5DB}>)
8: (SB-IMPL::TOPLEVEL-REPL NIL)
9: (SB-IMPL::TOPLEVEL-INIT)
10: ((FLET #:WITHOUT-INTERRUPTS-BODY-85 :IN SAVE-LISP-AND-DIE))
11: ((LABELS SB-IMPL::RESTART-LISP :IN SAVE-LISP-AND-DIE))

0]

Regards,

Lutz

Revision history for this message
Lutz Euler (lutz-euler) wrote :

I have bisected this to:

295fdbaa30b57128da30e1e5fb0c653dd20f46d1 is the first bad commit
commit 295fdbaa30b57128da30e1e5fb0c653dd20f46d1
Author: Nikodemus Siivola <email address hidden>
Date: Thu Dec 1 21:05:43 2011 +0200

    don't simplify (LET () ..) => (LOCALLY ...) in the simple evalutor

      If LET is at toplevel its subforms are not.

      If LOCALLY is at toplevel its subforms are also at toplevel.

That is SBCL 1.0.54.20.

Douglas Katzman (dougk)
Changed in sbcl:
assignee: nobody → Douglas Katzman (dougk)
status: New → Fix Committed
Changed in sbcl:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.