Ticket #990 (closed defect: duplicate)

Opened 22 months ago

Last modified 22 months ago

Incorrect code generated for simple loop

Reported by: hans Owned by:
Priority: normal Milestone:
Component: Compiler Version: 1.8
Keywords: Cc:

Description

Hi,

a user of Hunchentoot has reported problems with Clozure CL and MD5, and I was able to track this down to a problem in CCL (tested with 1.8 on Linux):

Welcome to Clozure Common Lisp Version 1.8-r15286M  (LinuxX8632)!
? (defun foo ()
  (let ((block (make-array 16)))
    (loop for index of-type (integer 0 16) from 0 below 16
          do (print index)
             (setf (aref block index) #x00000000))))
FOO
? (foo)

0 
1 
2 
3 
4 
5 
6 
7 
8 
9 
10 
11 
12 
13 
14 
15 
16 
> Error: Array index 16 out of bounds for #<SIMPLE-VECTOR 16> .
> While executing: FOO, in process listener(1).
> Type :POP to abort, :R for a list of available restarts.
> Type :? for other options.

If the type declaration in the loop is omitted, the problem does not occur.

Change History

comment:1 Changed 22 months ago by fare

Might it be a duplicate of #962? (Fixed in [15356]) What happens if you update to the latest CCL 1.8 patch release?

comment:2 Changed 22 months ago by hans

  • Status changed from new to closed
  • Resolution set to duplicate

This is indeed fixed in the latest 1.8 patch release. This bug is a duplicate.

Note: See TracTickets for help on using tickets.