TRUNCATE: unable to do inline float coercion (cost 5)
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
SBCL |
Invalid
|
Undecided
|
Unassigned |
Bug Description
SBCL 1.5.0 on Linux.
(defun foo ()
(declare (optimize speed))
(let* ((a (make-array 1 :element-type '(unsigned-byte 8)
(b (/ 1.0 (aref a 0))))
(truncate b 1)))
; in: DEFUN FOO
; (TRUNCATE B 1)
; --> LET
; ==>
; (SB-KERNEL:
;
; note: forced to do full call
; unable to do inline float truncate (cost 5) because:
; The result is a (VALUES (INTEGER -1) &OPTIONAL), not a (VALUES
; (SIGNED-BYTE 64)
; &REST T).
; --> LET VALUES - LOCALLY
; ==>
; (SB-KERNEL:
;
; note: forced to do full call
; unable to do inline float coercion (cost 5) because:
; The first argument is a (INTEGER -1), not a (SIGNED-BYTE 64).
;
; compilation unit finished
; printed 2 notes
Because it can be divided by zero producing an infinity.