TRUNCATE: unable to do inline float coercion (cost 5)

Bug #1820436 reported by Michał "phoe" Herda
6
This bug affects 1 person
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)
                          :initial-element 3))
         (b (/ 1.0 (aref a 0))))
    (truncate b 1)))

; in: DEFUN FOO
; (TRUNCATE B 1)
; --> LET
; ==>
; (SB-KERNEL:%UNARY-TRUNCATE/SINGLE-FLOAT SB-C::X)
;
; 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:%SINGLE-FLOAT SB-C::RES)
;
; 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

Revision history for this message
Stas Boukarev (stassats) wrote :

Because it can be divided by zero producing an infinity.

Changed in sbcl:
status: New → Invalid
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.