Opened 3 years ago

Closed 3 years ago

Last modified 3 years ago

#1398 closed defect (fixed)

Bug in complex array indexing/alignment

Reported by: tarballs_are_good Owned by: rme
Priority: normal Milestone:
Component: Compiler Version: trunk
Keywords: complex, double-floats, array indexing Cc:

Description

The following test case fails:

(defconstant ZERO #C(0.0d0 0.0d0))
(defconstant ONE #C(1.0d0 0.0d0))

(defun bug ()
  (LET ((RESULT (MAKE-ARRAY 2 :ELEMENT-TYPE '(COMPLEX DOUBLE-FLOAT)
                              :INITIAL-ELEMENT ZERO)))
    (DECLARE (TYPE (SIMPLE-ARRAY (COMPLEX DOUBLE-FLOAT) (2)) RESULT))
    (SETF (AREF RESULT 0) ONE)
    (FORMAT T "~&Set 0th to 1: ~A~%" RESULT)
    (SETF (AREF RESULT 1) ONE)
    (FORMAT T "~&Set 1st to 1: ~A~%" RESULT)
    RESULT))

It looks like the second SETF isn't SETFing far enough into whatever underlying representing. I get

> (bug)
Set 0th to 1: #(#C(1.0D0 0.0D0) #C(0.0D0 0.0D0))
Set 1st to 0: #(#C(0.0D0 5.299808824D-315) #C(0.0D0 0.0D0))
#(#C(0.0D0 5.299808824D-315) #C(0.0D0 0.0D0))

which indicates the second SETF isn't getting far enough.

Change History (3)

comment:1 Changed 3 years ago by rme

  • Owner set to rme
  • Status changed from new to assigned

comment:2 Changed 3 years ago by rme

  • Resolution set to fixed
  • Status changed from assigned to closed

(In [16806]) Correct scaling on x8664 when indexing complex double-float vectors

Closes ticket:1398

comment:3 Changed 3 years ago by rme

Added test in r16807.

Note: See TracTickets for help on using tickets.