Opened 5 years ago

Last modified 5 years ago

#1355 assigned defect

bad regspec: NIL compiling with speed 3 safety 0

Reported by: rtoy Owned by: gb
Priority: normal Milestone:
Component: Compiler Version: trunk
Keywords: Cc:

Description

Compile the following (same code as ticket #1354):

(defun $rfft (z)
  (declare (type (simple-array (complex double-float) (*)) z))
  (let* ((n (ash (length z) 1))
	 (result (make-array (1+ (length z)) :element-type '(complex double-float)
			     :initial-element #c(42d0 0))))
    (declare (type (simple-array (complex double-float) (*)) result))

    (when (< n 3)
      (return-from $rfft ($fft input)))
    (locally
	(declare (optimize (speed 3) (safety 0)))
      ;; Compute FFT of shorter complex vector.  NOTE: the result
      ;; returned by fft has scaled the output by the length of
      ;; z.  That is, divided by n/2.  For our final result, we want to
      ;;     divide by n, so in the following bits of code, we have an
      ;;     extra factor of 2 to divide by.
      ;;(setf z (fft-r2-nn z))

      (format t "z = ~A~%" z)
      ;; Reconstruct the FFT of the original from the parts
      (setf (aref result 0)
	    (complex (* 0.5
			(+ (realpart (aref z 0))
			   (imagpart (aref z 0))))
		     0))

      (format t "result = ~A~%" result)
      )
    ))

This produces the error message:

  bad regspec: NIL

If I remove the declaration from locally or change safety to 1, there's no error.

Version is Version 1.11-R16635 (Darwinx8664) running on OSX 10.11.3.

Change History (2)

comment:1 Changed 5 years ago by gb

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

comment:2 Changed 5 years ago by gb

FWIW, this seems to still be present in the CCL trunk.

Note: See TracTickets for help on using tickets.