Compiler bug involving double-float type

Bug #2084209 reported by Matt Kaufmann
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
SBCL
Fix Released
Undecided
Unassigned

Bug Description

An unexpected compilation error occurs with the SBCL version reported
below, obtained today from GitHub, on MacOS 10.15.7. But there is no
such error with SBCL 2.4.6 (released) on my Mac, or with SBCL 2.4.9
(released) on Linux. Perhaps the error is related to recent
improvements to avoid boxing of double-floats.

To see the error, evaluate the following forms.

(declaim (ftype (function (double-float t t t t t) *)
                foo))

(defun foo (scalar i row xpad xi xrow)
  (declare (type double-float scalar)
           (ignorable scalar i row xpad xi))
  xrow)

(defun bar (scalar i row xpad xi xrow)
  (foo (float scalar 0.0d0) i row xpad xi xrow))

The last of these has produced the following unexpected error.

* (defun bar (scalar i row xpad xi xrow)
  (foo (float scalar 0.0d0) i row xpad xi xrow))

debugger invoked on a SIMPLE-ERROR in thread
#<THREAD tid=775 "main thread" RUNNING {1001890003}>:
  #<SB-C:TN t1[RCX(d)] :NORMAL> is wired to location 1 in SC #<STORAGE-CLASS
                                                               :NAME SB-VM::DESCRIPTOR-REG> of kind :NORMAL that it conflicts with.

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.

(SB-REGALLOC::PACK-WIRED-TN #<SB-C:TN t1[RCX(d)] :NORMAL>)
0]

Here is information on version, OS, and *features*.

~/temp/j-oct9-sbcl-testing$ sbclx --version
SBCL 2.4.9.36-465757f12
~/temp/j-oct9-sbcl-testing$ uname -a
Darwin Matts-MacBook-Pro.local 19.6.0 Darwin Kernel Version 19.6.0: Tue Jun 21 21:18:39 PDT 2022; root:xnu-6153.141.66~1/RELEASE_X86_64 x86_64
~/temp/j-oct9-sbcl-testing$ sbclx
This is SBCL 2.4.9.36-465757f12, an implementation of ANSI Common Lisp.
More information about SBCL is available at <http://www.sbcl.org/>.

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.
* *features*
(:ARENA-ALLOCATOR :X86-64 :GENCGC :64-BIT :ANSI-CL :BSD :COMMON-LISP :DARWIN
 :IEEE-FLOATING-POINT :LITTLE-ENDIAN :MACH-O :PACKAGE-LOCAL-NICKNAMES :SB-LDB
 :SB-PACKAGE-LOCKS :SB-THREAD :SB-UNICODE :SBCL :UNIX)
*

Interestingly, if one argument is omitted as follows, then the error
disappears.

(declaim (ftype (function (double-float t t t t) *)
                foo))

(defun foo (scalar i row xi xrow)
  (declare (type double-float scalar)
           (ignorable scalar i row xi))
  xrow)

(defun bar (scalar i row xi xrow)
  (foo (float scalar 0.0d0) i row xi xrow))

Revision history for this message
Matt Kaufmann (kaufmann) wrote :

I should have noted that I always build SBCL from source, as follows:

sh make.sh --without-immobile-space --without-immobile-code --without-compact-instance-header

Stas Boukarev (stassats)
Changed in sbcl:
status: New → 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.