[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]


(defun foo (x)
  (declare (type (simple-array (unsigned-byte 4) (8)) x))
  (aref x 0))

It should be able to tell that the aref is going to be in bounds because of
the type.  Check-bound gets called with the index and bound as constants,
it just needs to note that it will always work and punt on the actual

When I was working on fixing the small-data-vector-refs for the RT, I was
comparing the SPARC (big-endian) and the MIPS (little-endian) version and
noticed that the SPARC version was broken if the index was a constant and
an even multiple of the number of elements per word.  But this didn't
matter, because that vop was (almost) never used.  The index never showed
up as constant because the check-bounds never got folded.  The only time it
uses that vop is in an unsafe policy, because the check-bound gets deleted.