Opened 12 years ago

Closed 12 years ago

#370 closed defect (fixed)

AREF/ASET optimizations with undeclared rank

Reported by: gz Owned by: gb
Priority: normal Milestone:
Component: Performance Version:
Keywords: Cc:


From gb:

(declare (type (simple-array double-float) a b))

declares that A and B are SIMPLE-ARRAYs with unspecified dimensionality. We'll generally only try to open-code the AREF/CCL::ASET if the dimensionality of the array is specified in the declaration.

In "reasonably safe" code, if the declared dimensionality of the array was unpecified (or specified as *), we could treat

(aref a i)


(%typed-aref (type-of a) a i)

and typecheck that A is in fact a one-dimensional array of the declared type before doing anything with it. If A was in fact of the wrong dimensionality, we'd get a type error (A isn't a simple-one-dimensional-array of the specified type) rather than a wrong-number-of-subscripts error, but I don't think that AREF's error behavior is too rigidly specified. In unsafe code, we crash and burn if the actual dimensionality doesn't match, but win in more cases if it does.

Change History (1)

comment:1 Changed 12 years ago by rme

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

Fixed by r11286/r11287, I think.

Note: See TracTickets for help on using tickets.