instance-set-multiple doesn't handle float type in arm64 properly

Bug #2058148 reported by Bibek Panthi
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
SBCL
Fix Released
Undecided
Unassigned

Bug Description

Following code fails to compile:

```lisp
(defstruct input-status status time)

(defun handle-input ()
  (let ((status (make-input-status)))
    (setf (input-status-status status) (input-status-status status)
          (input-status-time status) 0.0)))
```

I get the following message:

  0.0 fell through ETYPECASE expression.
  Wanted one of (INTEGER CHARACTER SYMBOL).

I got around this error while trying to run lispbuilder-sdl. This is the minimum code that triggers the compiler bug.

What seems to me is that a branch for float type is missing in vop definition of instance-set-multiple for arm architecture. This is hinted by the backtrace:

Backtrace:
 0: ((SB-C::VOP SB-VM::INSTANCE-SET-MULTIPLE) #<SB-C::VOP :INFO SB-VM::INSTANCE-SET-MULTIPLE :ARGS #<SB-C:TN-REF :TN #<SB-C:TN t1[R0] :NORMAL> :WRITE-P NIL :VOP SB-VM::INSTANCE-SET-MULTIPLE> :RESULTS NIL ..
 1: (SB-C::GENERATE-CODE #<SB-C:COMPONENT :NAME "<unknown>" {700DA2A293}>)
 2: (SB-C::%COMPILE-COMPONENT #<SB-C:COMPONENT :NAME "<unknown>" {700DA2A293}>)
 3: (SB-C::COMPILE-COMPONENT #<SB-C:COMPONENT :NAME "<unknown>" {700DA2A293}>)
 4: (SB-C::%COMPILE (SB-INT:NAMED-LAMBDA HANDLE-INPUT NIL (BLOCK HANDLE-INPUT (LET # #))) NIL NIL)
 5: ((LAMBDA NIL :IN SB-C:COMPILE-IN-LEXENV))
 6: ((FLET SB-C::WITH-IT :IN SB-C::%WITH-COMPILATION-UNIT))
 7: (SB-C:COMPILE-IN-LEXENV (SB-INT:NAMED-LAMBDA HANDLE-INPUT NIL (BLOCK HANDLE-INPUT (LET # #))) #<NULL-LEXENV> NIL NIL NIL NIL T)

2. SBCL VERSIONS: 2.4.1 and 2.4.2

I ran this code in MacOS M1 Pro Sonoma 14.1 (arm64) with sbcl-2.4.1 installed from homebrew and sbcl-2.4.2 that I built from source.

3. uname -a

  Darwin bpanthi977-mac.local 23.1.0 Darwin Kernel Version 23.1.0: Mon Oct 9 21:27:24 PDT 2023; root:xnu-10002.41.9~6/RELEASE_ARM64_T6000 arm64

4. *FEATURES*

(:QUICKLISP :ASDF3.3 :ASDF3.2 :ASDF3.1 :ASDF3 :ASDF2 :ASDF :OS-MACOSX :OS-UNIX
 :NON-BASE-CHARS-EXIST-P :ASDF-UNICODE :ARM64 :GENCGC :64-BIT :ANSI-CL :BSD
 :COMMON-LISP :DARWIN :IEEE-FLOATING-POINT :LITTLE-ENDIAN :MACH-O
 :PACKAGE-LOCAL-NICKNAMES :SB-CORE-COMPRESSION :SB-LDB :SB-PACKAGE-LOCKS
 :SB-THREAD :SB-UNICODE :SBCL :UNIX)

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