Different values computed in optimized vs. unopt code (random testing)

Bug #1717369 reported by Paul F. Dietz
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
SBCL
Fix Released
Undecided
Unassigned

Bug Description

This was found by random testing on an SBCL x86 64 image built from source downloaded from github on 13/9/2017.

(defparameter *body*
  '(deposit-field
    (if (>= a 0)
 0
 131072)
    (byte 12 14)
    (logandc2 (* a c)
     (unwind-protect 5233637))))

(defun ftest3 ()
  (let ((fn1
  `(lambda (a c)
     (declare (type (integer -329826015068 198680020865) a))
     (declare (type (integer -25542480 21150532) c))
     (declare (optimize (safety 2) (debug 0) (space 0)
          (compilation-speed 1) (speed 2)))
     ,*body*))
 (fn2
  `(lambda (a c)
     ,*body*))
 (vals '(-25845520859 -20524970)))
    (values
     (apply (compile nil fn1) vals)
     (apply (compile nil fn2) vals))))

(ftest3) ==> 530478540240461834, 530478540240592906

The first value appears to be incorrect.

Revision history for this message
Paul F. Dietz (paul-f-dietz) wrote :

By the way, this does not occur in 1.3.21.

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

In 86dc287bb9343e454154ad7682636f47632bc348.

Changed in sbcl:
status: New → Fix Committed
Revision history for this message
Stas Boukarev (stassats) wrote :

Rather eb26de5438e49a4d7b55d258fb8e4c5f15d8dfee.

Stas Boukarev (stassats)
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.